|
||||||||||
| 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.SingleFieldMapping
org.datanucleus.store.mapped.mapping.OIDMapping
org.datanucleus.store.mapped.mapping.PersistableMapping
public class PersistableMapping
Maps a java field to a persistable class. For persistable classes using datastore-id most of the behaviour is coded in the OIDMapping superclass. TODO Split this from OIDMapping since PCMapping may represent app-id instead of datastore-id TODO Move column creation for join table collection/map/array of PC to this class
| Field Summary | |
|---|---|
protected AbstractClassMetaData |
cmd
ClassMetaData for the represented class. |
protected JavaTypeMapping[] |
javaTypeMappings
Mappings for all fields necessary to represent the id of the PC object. |
| Fields inherited from class org.datanucleus.store.mapped.mapping.JavaTypeMapping |
|---|
datastoreContainer, datastoreMappings, LOCALISER, mmd, referenceMapping, roleForMember, storeMgr, type |
| Constructor Summary | |
|---|---|
PersistableMapping()
Create a new empty PersistenceCapableMapping. |
|
| Method Summary | |
|---|---|
void |
addJavaTypeMapping(JavaTypeMapping mapping)
Add a new JavaTypeMapping |
DatastoreMapping |
getDatastoreMapping(int index)
Accessor for a datastore mapping. |
DatastoreMapping[] |
getDatastoreMappings()
Accessor for the datastore mappings for this java type. |
JavaTypeMapping[] |
getJavaTypeMapping()
Accessor for the Java type mappings |
int |
getNumberOfDatastoreMappings()
Accessor for the number of datastore fields. |
java.lang.Object |
getObject(ExecutionContext ec,
java.lang.Object rs,
int[] param)
Returns a instance of a PersistenceCapable class. |
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 mmd,
DatastoreContainerObject container,
ClassLoaderResolver clr)
Initialize this JavaTypeMapping with the given DatastoreAdapter for the given metadata. |
void |
insertPostProcessing(ObjectProvider op)
Hook so that we can handle any post-processing on the insert of a particular field. |
void |
postFetch(ObjectProvider sm)
Method executed just after a fetch of the owning object, allowing any necessary action to this field and the object stored in it. |
void |
postInsert(ObjectProvider sm)
Method executed just after the insert of the owning object, allowing any necessary action to this field and the object stored in it. |
void |
postUpdate(ObjectProvider sm)
Method executed just afer any update of the owning object, allowing any necessary action to this field and the object stored in it. |
void |
preDelete(ObjectProvider sm)
Method executed just before the owning object is deleted, allowing tidying up of any relation information. |
protected void |
prepareDatastoreMapping()
Method to prepare the PC mapping and add its associated datastore mappings. |
protected void |
prepareDatastoreMapping(ClassLoaderResolver clr)
Method to prepare the PC mapping and add its associated datastore mappings. |
void |
setObject(ExecutionContext ec,
java.lang.Object ps,
int[] param,
java.lang.Object value)
Method to set an object in the datastore. |
void |
setObject(ExecutionContext ec,
java.lang.Object ps,
int[] param,
java.lang.Object value,
ObjectProvider ownerSM,
int ownerFieldNumber)
Method to set an object reference (FK) in the datastore. |
| Methods inherited from class org.datanucleus.store.mapped.mapping.OIDMapping |
|---|
getJavaType |
| Methods inherited from class org.datanucleus.store.mapped.mapping.SingleFieldMapping |
|---|
equals, getBoolean, getByte, getChar, getDefaultLength, getDouble, getFloat, getInt, getJavaTypeForDatastoreMapping, getLong, getShort, getString, getValidValues, setBoolean, setByte, setChar, setDouble, setFloat, setInt, setLong, setShort, setString |
| Methods inherited from class org.datanucleus.store.mapped.mapping.JavaTypeMapping |
|---|
addDatastoreMapping, failureMessage, getColumnMetaDataForMember, getDatastoreContainer, getMemberMetaData, getObject, getReferenceMapping, getRoleForMember, getType, hashCode, hasSimpleDatastoreRepresentation, includeInFetchStatement, includeInInsertStatement, includeInUpdateStatement, initialize, isNullable, isSerialised, setDatastoreContainer, setMemberMetaData, setReferenceMapping, setRoleForMember |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected JavaTypeMapping[] javaTypeMappings
protected AbstractClassMetaData cmd
| Constructor Detail |
|---|
public PersistableMapping()
| Method Detail |
|---|
public void initialize(AbstractMemberMetaData mmd,
DatastoreContainerObject container,
ClassLoaderResolver clr)
initialize in class SingleFieldMappingmmd - MetaData for the field/property to be mapped (if any)container - The datastore container storing this mapping (if any)clr - the ClassLoaderResolverpublic void addJavaTypeMapping(JavaTypeMapping mapping)
mapping - the JavaTypeMappingprotected void prepareDatastoreMapping()
prepareDatastoreMapping in class SingleFieldMappingprotected void prepareDatastoreMapping(ClassLoaderResolver clr)
clr - The ClassLoaderResolverpublic JavaTypeMapping[] getJavaTypeMapping()
public int getNumberOfDatastoreMappings()
getNumberOfDatastoreMappings in class JavaTypeMappingpublic DatastoreMapping getDatastoreMapping(int index)
getDatastoreMapping in class JavaTypeMappingindex - The position of the mapping.
public DatastoreMapping[] getDatastoreMappings()
getDatastoreMappings in class JavaTypeMapping
public java.lang.Object getValueForDatastoreMapping(OMFContext omfCtx,
int index,
java.lang.Object value)
getValueForDatastoreMapping in class JavaTypeMappingomfCtx - OMF Contextindex - The datastore indexvalue - The overall value for this java type
public void setObject(ExecutionContext ec,
java.lang.Object ps,
int[] param,
java.lang.Object value)
setObject in class OIDMappingec - The ObjectManagerps - The Prepared Statementparam - The parameter ids in the statementvalue - The value to put in the statement at these ids
NotYetFlushedException
public void setObject(ExecutionContext ec,
java.lang.Object ps,
int[] param,
java.lang.Object value,
ObjectProvider ownerSM,
int ownerFieldNumber)
setObject in class JavaTypeMappingec - The Object Managerps - The Prepared Statementparam - The parameter ids in the statementvalue - The value to put in the statement at these idsownerSM - StateManager for the owner objectownerFieldNumber - Field number of this PC object in the owner
NotYetFlushedException
public java.lang.Object getObject(ExecutionContext ec,
java.lang.Object rs,
int[] param)
getObject in class OIDMappingec - execution contextrs - The ResultSetparam - Array of parameter ids in the ResultSet to retrieve
public void postFetch(ObjectProvider sm)
postFetch in interface MappingCallbackssm - StateManager for the owner.public void insertPostProcessing(ObjectProvider op)
MappingCallbacks
insertPostProcessing in interface MappingCallbacksop - ObjectProviderpublic void postInsert(ObjectProvider sm)
postInsert in interface MappingCallbackssm - StateManager for the ownerpublic void postUpdate(ObjectProvider sm)
postUpdate in interface MappingCallbackssm - StateManager for the ownerpublic void preDelete(ObjectProvider sm)
preDelete in interface MappingCallbackssm - StateManager for the owner
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||