org.datanucleus.store.mapped.mapping
Class JodaPeriodMapping

java.lang.Object
  extended by org.datanucleus.store.mapped.mapping.JavaTypeMapping
      extended by org.datanucleus.store.mapped.mapping.SingleFieldMapping
          extended by org.datanucleus.store.mapped.mapping.JodaPeriodMapping

public class JodaPeriodMapping
extends org.datanucleus.store.mapped.mapping.SingleFieldMapping

SCO Mapping for org.joda.time.Period type. Can be persisted using either

See http://joda-time.sourceforge.net/


Field Summary
 
Fields inherited from class org.datanucleus.store.mapped.mapping.JavaTypeMapping
datastoreContainer, datastoreMappings, LOCALISER, mmd, referenceMapping, roleForMember, storeMgr, type
 
Constructor Summary
JodaPeriodMapping()
           
 
Method Summary
 java.lang.Class getJavaType()
           
 java.lang.String getJavaTypeForDatastoreMapping(int index)
          Accessor for the name of the java-type actually used when mapping the particular datastore field.
 java.lang.Object getObject(org.datanucleus.store.ExecutionContext ec, java.lang.Object resultSet, int[] exprIndex)
          Method to get the object from the datastore and convert to an object.
 void setObject(org.datanucleus.store.ExecutionContext ec, java.lang.Object preparedStatement, int[] exprIndex, java.lang.Object value)
          Method to set the object when updating the the datastore.
 
Methods inherited from class org.datanucleus.store.mapped.mapping.SingleFieldMapping
equals, getBoolean, getByte, getChar, getDefaultLength, getDouble, getFloat, getInt, getLong, getShort, getString, getValidValues, initialize, prepareDatastoreMapping, setBoolean, setByte, setChar, setDouble, setFloat, setInt, setLong, setShort, setString
 
Methods inherited from class org.datanucleus.store.mapped.mapping.JavaTypeMapping
addDatastoreMapping, failureMessage, getColumnMetaDataForMember, getDatastoreContainer, getDatastoreMapping, getDatastoreMappings, getMemberMetaData, getNumberOfDatastoreMappings, getObject, getReferenceMapping, getRoleForMember, getStoreManager, getType, getValueForDatastoreMapping, hashCode, hasSimpleDatastoreRepresentation, includeInFetchStatement, includeInInsertStatement, includeInUpdateStatement, initialize, isNullable, isSerialised, setDatastoreContainer, setMemberMetaData, setObject, setReferenceMapping, setRoleForMember
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JodaPeriodMapping

public JodaPeriodMapping()
Method Detail

getJavaType

public java.lang.Class getJavaType()
Specified by:
getJavaType in class org.datanucleus.store.mapped.mapping.JavaTypeMapping

getJavaTypeForDatastoreMapping

public java.lang.String getJavaTypeForDatastoreMapping(int index)
Accessor for the name of the java-type actually used when mapping the particular datastore field. This java-type must have an entry in the datastore mappings.

Overrides:
getJavaTypeForDatastoreMapping in class org.datanucleus.store.mapped.mapping.SingleFieldMapping
Parameters:
index - requested datastore field index.
Returns:
the name of java-type for the requested datastore field.

setObject

public void setObject(org.datanucleus.store.ExecutionContext ec,
                      java.lang.Object preparedStatement,
                      int[] exprIndex,
                      java.lang.Object value)
Method to set the object when updating the the datastore.

Overrides:
setObject in class org.datanucleus.store.mapped.mapping.SingleFieldMapping
See Also:
SingleFieldMapping.setObject(org.datanucleus.store.ExecutionContext, java.lang.Object, int[], java.lang.Object)

getObject

public java.lang.Object getObject(org.datanucleus.store.ExecutionContext ec,
                                  java.lang.Object resultSet,
                                  int[] exprIndex)
Method to get the object from the datastore and convert to an object.

Overrides:
getObject in class org.datanucleus.store.mapped.mapping.SingleFieldMapping
See Also:
SingleFieldMapping.getObject(org.datanucleus.store.ExecutionContext, java.lang.Object, int[])


Copyright © 2011. All Rights Reserved.