|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.datanucleus.store.mapped.mapping.JavaTypeMapping
org.datanucleus.store.mapped.mapping.SingleFieldMultiMapping
org.datanucleus.store.mapped.mapping.GregorianCalendarMapping
public class GregorianCalendarMapping
Maps the class fields of a GregorianCalendar to datastore field(s). JPOX traditionally supported this as mapping to 2 datastore fields (timestamp millisecs and timezone). Here we also support it as mapping to a single datastore field (timestamp).
| Field Summary |
|---|
| Fields inherited from class org.datanucleus.store.mapped.mapping.JavaTypeMapping |
|---|
datastoreContainer, datastoreMappings, LOCALISER, mmd, referenceMapping, roleForMember, storeMgr, type |
| Constructor Summary | |
|---|---|
GregorianCalendarMapping()
|
|
| Method Summary | |
|---|---|
protected void |
addDatastoreFields()
|
java.lang.Class |
getJavaType()
Accessor for the java type being mapped. |
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(ExecutionContext ec,
java.lang.Object resultSet,
int[] exprIndex)
Obtains a value from datastoreResults
at position specified by exprIndex. |
java.lang.Object |
getValueForDatastoreMapping(OMFContext omfCtx,
int index,
java.lang.Object value)
Method to return the value to be stored in the specified datastore index given the overall value for this java type. |
void |
initialize(AbstractMemberMetaData fmd,
DatastoreContainerObject container,
ClassLoaderResolver clr)
Initialize this JavaTypeMapping for the supplied table and field/property metadata. |
void |
initialize(MappedStoreManager storeMgr,
java.lang.String type)
Initialize this JavaTypeMapping with the given StoreManager for the given type. |
void |
setObject(ExecutionContext ec,
java.lang.Object preparedStatement,
int[] exprIndex,
java.lang.Object value)
Sets a value into datastoreStatement
at position specified by exprIndex. |
| Methods inherited from class org.datanucleus.store.mapped.mapping.SingleFieldMultiMapping |
|---|
addDatastoreField, hasSimpleDatastoreRepresentation |
| Methods inherited from class org.datanucleus.store.mapped.mapping.JavaTypeMapping |
|---|
addDatastoreMapping, equals, failureMessage, getBoolean, getByte, getChar, getColumnMetaDataForMember, getDatastoreContainer, getDatastoreMapping, getDatastoreMappings, getDouble, getFloat, getInt, getLong, getMemberMetaData, getNumberOfDatastoreMappings, getObject, getReferenceMapping, getRoleForMember, getShort, getString, getType, hashCode, includeInFetchStatement, includeInInsertStatement, includeInUpdateStatement, isNullable, isSerialised, setBoolean, setByte, setChar, setDatastoreContainer, setDouble, setFloat, setInt, setLong, setMemberMetaData, setObject, setReferenceMapping, setRoleForMember, setShort, setString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GregorianCalendarMapping()
| Method Detail |
|---|
public void initialize(AbstractMemberMetaData fmd,
DatastoreContainerObject container,
ClassLoaderResolver clr)
JavaTypeMapping
initialize in class JavaTypeMappingfmd - MetaData for the field/property to be mapped (if any)container - The datastore container storing this mapping (if any)clr - the ClassLoaderResolver
public void initialize(MappedStoreManager storeMgr,
java.lang.String type)
JavaTypeMapping
initialize in class JavaTypeMappingstoreMgr - The Datastore Adapter that this Mapping should use.type - The Class that this mapping maps to the database.MappingFactory.createMapping(Class, MappedStoreManager, String)protected void addDatastoreFields()
public java.lang.Class getJavaType()
JavaTypeMapping
getJavaType in class JavaTypeMappingpublic java.lang.String getJavaTypeForDatastoreMapping(int index)
getJavaTypeForDatastoreMapping in class SingleFieldMultiMappingindex - requested datastore field index.
public java.lang.Object getValueForDatastoreMapping(OMFContext omfCtx,
int index,
java.lang.Object value)
getValueForDatastoreMapping in class JavaTypeMappingindex - The datastore indexvalue - The overall value for this java typeomfCtx - OMF Context
public void setObject(ExecutionContext ec,
java.lang.Object preparedStatement,
int[] exprIndex,
java.lang.Object value)
JavaTypeMappingvalue into datastoreStatement
at position specified by exprIndex.
setObject in class JavaTypeMappingec - ExecutionContextpreparedStatement - a datastore object that executes statements in the databaseexprIndex - the position of the value in the statementvalue - the value
public java.lang.Object getObject(ExecutionContext ec,
java.lang.Object resultSet,
int[] exprIndex)
JavaTypeMappingdatastoreResults
at position specified by exprIndex.
getObject in class JavaTypeMappingec - ExecutionContextresultSet - an object returned from the datastore with valuesexprIndex - the position of the value in the result
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||