|
||||||||||
| 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.MultiMapping
org.datanucleus.store.mapped.mapping.PersistableMapping
public class PersistableMapping
Maps a field storing a persistable object. 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. |
| Fields inherited from class org.datanucleus.store.mapped.mapping.MultiMapping |
|---|
javaTypeMappings, numberOfDatastoreMappings |
| Fields inherited from class org.datanucleus.store.mapped.mapping.JavaTypeMapping |
|---|
absFieldNumber, datastoreContainer, datastoreMappings, LOCALISER, mmd, referenceMapping, roleForMember, storeMgr, type |
| Constructor Summary | |
|---|---|
PersistableMapping()
Create a new empty PersistableMapping. |
|
| Method Summary | |
|---|---|
Class |
getJavaType()
Accessor for the java type being mapped. |
Object |
getObject(ExecutionContext ec,
Object rs,
int[] resultIndexes)
Returns an instance of a persistable class. |
Object |
getValueForDatastoreMapping(NucleusContext nucleusCtx,
int index,
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(ClassLoaderResolver clr)
Method to prepare the PC mapping and add its associated datastore mappings. |
void |
setObject(ExecutionContext ec,
Object ps,
int[] param,
Object value)
Method to set an object in the datastore. |
void |
setObject(ExecutionContext ec,
Object ps,
int[] param,
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.MultiMapping |
|---|
addJavaTypeMapping, getDatastoreMapping, getDatastoreMappings, getJavaTypeMapping, getNumberOfDatastoreMappings |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected AbstractClassMetaData cmd
| Constructor Detail |
|---|
public PersistableMapping()
| Method Detail |
|---|
public Class getJavaType()
JavaTypeMapping
getJavaType in class JavaTypeMapping
public void initialize(AbstractMemberMetaData mmd,
DatastoreContainerObject container,
ClassLoaderResolver clr)
initialize in class JavaTypeMappingmmd - MetaData for the field/property to be mapped (if any)container - The datastore container storing this mapping (if any)clr - the ClassLoaderResolverprotected void prepareDatastoreMapping(ClassLoaderResolver clr)
clr - The ClassLoaderResolver
public Object getValueForDatastoreMapping(NucleusContext nucleusCtx,
int index,
Object value)
getValueForDatastoreMapping in class JavaTypeMappingnucleusCtx - Contextindex - The datastore indexvalue - The overall value for this java type
public void setObject(ExecutionContext ec,
Object ps,
int[] param,
Object value)
setObject in class JavaTypeMappingec - The ExecutionContextps - 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,
Object ps,
int[] param,
Object value,
ObjectProvider ownerSM,
int ownerFieldNumber)
setObject in class JavaTypeMappingec - The ExecutionContextps - 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 Object getObject(ExecutionContext ec,
Object rs,
int[] resultIndexes)
getObject in class JavaTypeMappingec - execution contextrs - The ResultSetresultIndexes - indexes 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 | |||||||||