public class PersistableMapping extends MultiMapping implements MappingCallbacks
| Modifier and Type | Field and Description |
|---|---|
protected org.datanucleus.metadata.AbstractClassMetaData |
cmd
ClassMetaData for the represented class; creating a new one on each getObject invoke is expensive
|
javaTypeMappings, numberOfDatastoreMappingsabsFieldNumber, datastoreMappings, mmd, referenceMapping, roleForMember, storeMgr, table, type| Constructor and Description |
|---|
PersistableMapping()
Create a new empty PersistableMapping.
|
| Modifier and Type | Method and Description |
|---|---|
Class |
getJavaType()
Accessor for the java type being mapped.
|
Object |
getObject(org.datanucleus.ExecutionContext ec,
ResultSet rs,
int[] resultIndexes)
Returns an instance of a persistable class.
|
Object |
getValueForDatastoreMapping(org.datanucleus.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(org.datanucleus.metadata.AbstractMemberMetaData mmd,
Table table,
org.datanucleus.ClassLoaderResolver clr)
Initialize this JavaTypeMapping with the given DatastoreAdapter for the given metadata.
|
void |
insertPostProcessing(org.datanucleus.state.ObjectProvider op)
Hook so that we can handle any post-processing on the insert of a particular field.
|
void |
postFetch(org.datanucleus.state.ObjectProvider op)
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(org.datanucleus.state.ObjectProvider op)
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(org.datanucleus.state.ObjectProvider op)
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(org.datanucleus.state.ObjectProvider op)
Method executed just before the owning object is deleted, allowing tidying up of any relation information.
|
protected void |
prepareDatastoreMapping(org.datanucleus.ClassLoaderResolver clr)
Method to prepare the PC mapping and add its associated datastore mappings.
|
void |
setObject(org.datanucleus.ExecutionContext ec,
PreparedStatement ps,
int[] param,
Object value)
Method to set an object in the datastore.
|
void |
setObject(org.datanucleus.ExecutionContext ec,
PreparedStatement ps,
int[] param,
Object value,
org.datanucleus.state.ObjectProvider ownerOP,
int ownerFieldNumber)
Method to set an object reference (FK) in the datastore.
|
addJavaTypeMapping, getDatastoreMapping, getDatastoreMappings, getJavaTypeMapping, getNumberOfDatastoreMappingsaddDatastoreMapping, equals, failureMessage, getAbsoluteFieldNumber, getBoolean, getByte, getChar, getColumnMetaDataForMember, getDouble, getFloat, getInt, getJavaTypeForDatastoreMapping, getLong, getMemberMetaData, getObject, getReferenceMapping, getRoleForMember, getShort, getStoreManager, getString, getTable, getType, hashCode, hasSimpleDatastoreRepresentation, includeInFetchStatement, includeInInsertStatement, includeInUpdateStatement, initialize, isNullable, isSerialised, representableAsStringLiteralInStatement, setAbsFieldNumber, setBoolean, setByte, setChar, setDouble, setFloat, setInt, setLong, setMemberMetaData, setReferenceMapping, setRoleForMember, setShort, setString, setTableprotected org.datanucleus.metadata.AbstractClassMetaData cmd
public PersistableMapping()
public Class getJavaType()
JavaTypeMappinggetJavaType in class JavaTypeMappingpublic void initialize(org.datanucleus.metadata.AbstractMemberMetaData mmd,
Table table,
org.datanucleus.ClassLoaderResolver clr)
initialize in class JavaTypeMappingmmd - MetaData for the field/property to be mapped (if any)table - The datastore container storing this mapping (if any)clr - the ClassLoaderResolverprotected void prepareDatastoreMapping(org.datanucleus.ClassLoaderResolver clr)
clr - The ClassLoaderResolverpublic Object getValueForDatastoreMapping(org.datanucleus.NucleusContext nucleusCtx, int index, Object value)
getValueForDatastoreMapping in class JavaTypeMappingnucleusCtx - Contextindex - The datastore indexvalue - The overall value for this java typepublic void setObject(org.datanucleus.ExecutionContext ec,
PreparedStatement 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 idsorg.datanucleus.exceptions.NotYetFlushedException - if an object hasn't yet been flushed to the datastorepublic void setObject(org.datanucleus.ExecutionContext ec,
PreparedStatement ps,
int[] param,
Object value,
org.datanucleus.state.ObjectProvider ownerOP,
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 idsownerOP - ObjectProvider for the owner objectownerFieldNumber - Field number of this PC object in the ownerorg.datanucleus.exceptions.NotYetFlushedException - if an object hasn't yet been flushed to the datastorepublic Object getObject(org.datanucleus.ExecutionContext ec, ResultSet rs, int[] resultIndexes)
getObject in class JavaTypeMappingec - execution contextrs - The ResultSetresultIndexes - indexes in the ResultSet to retrievepublic void postFetch(org.datanucleus.state.ObjectProvider op)
postFetch in interface MappingCallbacksop - ObjectProvider for the owner.public void insertPostProcessing(org.datanucleus.state.ObjectProvider op)
MappingCallbacksinsertPostProcessing in interface MappingCallbacksop - ObjectProviderpublic void postInsert(org.datanucleus.state.ObjectProvider op)
postInsert in interface MappingCallbacksop - ObjectProvider for the ownerpublic void postUpdate(org.datanucleus.state.ObjectProvider op)
postUpdate in interface MappingCallbacksop - ObjectProvider for the ownerpublic void preDelete(org.datanucleus.state.ObjectProvider op)
preDelete in interface MappingCallbacksop - ObjectProvider for the ownerCopyright © 2019. All rights reserved.