org.datanucleus.store.mapped.mapping
Class JodaIntervalMapping

java.lang.Object
  extended by org.datanucleus.store.mapped.mapping.JavaTypeMapping
      extended by org.datanucleus.store.mapped.mapping.SingleFieldMultiMapping
          extended by org.datanucleus.store.mapped.mapping.JodaIntervalMapping

public class JodaIntervalMapping
extends org.datanucleus.store.mapped.mapping.SingleFieldMultiMapping

SCO Mapping for org.joda.time.Interval 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
JodaIntervalMapping()
           
 
Method Summary
protected  void addDatastoreFields()
           
 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 rs, int[] exprIndex)
           
 java.lang.Object getValueForDatastoreMapping(org.datanucleus.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(org.datanucleus.metadata.AbstractMemberMetaData fmd, org.datanucleus.store.mapped.DatastoreContainerObject container, org.datanucleus.ClassLoaderResolver clr)
           
 void initialize(org.datanucleus.store.mapped.MappedStoreManager storeMgr, java.lang.String type)
           
 void setObject(org.datanucleus.store.ExecutionContext ec, java.lang.Object ps, int[] exprIndex, java.lang.Object value)
           
 
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

JodaIntervalMapping

public JodaIntervalMapping()
Method Detail

initialize

public void initialize(org.datanucleus.metadata.AbstractMemberMetaData fmd,
                       org.datanucleus.store.mapped.DatastoreContainerObject container,
                       org.datanucleus.ClassLoaderResolver clr)
Overrides:
initialize in class org.datanucleus.store.mapped.mapping.JavaTypeMapping

initialize

public void initialize(org.datanucleus.store.mapped.MappedStoreManager storeMgr,
                       java.lang.String type)
Overrides:
initialize in class org.datanucleus.store.mapped.mapping.JavaTypeMapping

addDatastoreFields

protected void addDatastoreFields()

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.SingleFieldMultiMapping
Parameters:
index - requested datastore field index.
Returns:
the name of java-type for the requested datastore field.

getJavaType

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

getValueForDatastoreMapping

public java.lang.Object getValueForDatastoreMapping(org.datanucleus.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.

Overrides:
getValueForDatastoreMapping in class org.datanucleus.store.mapped.mapping.JavaTypeMapping
Parameters:
index - The datastore index
value - The overall value for this java type
Returns:
The value for this datastore index

getObject

public java.lang.Object getObject(org.datanucleus.store.ExecutionContext ec,
                                  java.lang.Object rs,
                                  int[] exprIndex)
Overrides:
getObject in class org.datanucleus.store.mapped.mapping.JavaTypeMapping

setObject

public void setObject(org.datanucleus.store.ExecutionContext ec,
                      java.lang.Object ps,
                      int[] exprIndex,
                      java.lang.Object value)
Overrides:
setObject in class org.datanucleus.store.mapped.mapping.JavaTypeMapping


Copyright © 2011. All Rights Reserved.