public abstract class ReferenceMapping extends MultiPersistableMapping implements MappingCallbacks
| Modifier and Type | Field and Description |
|---|---|
static int |
ID_MAPPING
Single column containing the "identity" of an object.
|
protected int |
mappingStrategy
Strategy for how the reference(s) are mapped.
|
static int |
PER_IMPLEMENTATION_MAPPING
Each implementation has its own column(s) as a FK to the related table.
|
static int |
XCALIA_MAPPING
Single column containing the Xcalia form of the "identity" of an object.
|
javaTypeMappings, numberOfColumnMappingsabsFieldNumber, columnMappings, mmd, referenceMapping, roleForMember, storeMgr, table, type| Constructor and Description |
|---|
ReferenceMapping() |
| Modifier and Type | Method and Description |
|---|---|
Class |
getJavaType()
Accessor for the java type being mapped.
|
String |
getJavaTypeForColumnMapping(int index)
Accessor for the java type represented by a particular datastore mapping.
|
JavaTypeMapping |
getJavaTypeMappingForType(Class type)
Method to return the submapping for the specified (implementation) type.
|
int |
getMappingNumberForValue(org.datanucleus.ExecutionContext ec,
Object value)
Convenience accessor for the number of the java type mapping where the passed value would be
stored.
|
int |
getMappingStrategy()
Accessor for the mapping strategy.
|
Object |
getObject(org.datanucleus.ExecutionContext ec,
ResultSet rs,
int[] pos)
Method to retrieve an object of this type from the ResultSet.
|
protected Object |
getObjectForReferenceString(org.datanucleus.ExecutionContext ec,
String refString)
Method to convert a "reference string" into the associated object.
|
protected String |
getReferenceStringForObject(org.datanucleus.ExecutionContext ec,
Object value)
Method to convert an object to be stored into a "reference string" to store.
|
void |
initialize(org.datanucleus.metadata.AbstractMemberMetaData mmd,
Table table,
org.datanucleus.ClassLoaderResolver clr)
Initialize this JavaTypeMapping for the specified field/property.
|
void |
insertPostProcessing(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 |
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 |
prepareColumnMapping(org.datanucleus.ClassLoaderResolver clr)
Convenience method to create the necessary columns to represent this reference in the datastore.
|
void |
setObject(org.datanucleus.ExecutionContext ec,
PreparedStatement ps,
int[] pos,
Object value,
org.datanucleus.state.ObjectProvider ownerOP,
int ownerFieldNumber)
Sets the specified positions in the PreparedStatement associated with this field, and value.
|
setObjectaddJavaTypeMapping, getColumnMapping, getColumnMappings, getJavaTypeMapping, getNumberOfColumnMappingsaddColumnMapping, equals, failureMessage, getAbsoluteFieldNumber, getBoolean, getByte, getChar, getColumnMetaDataForMember, getDouble, getFloat, getInt, getLong, getMemberMetaData, getObject, getReferenceMapping, getRoleForMember, getShort, getStoreManager, getString, getTable, getType, getValueForColumnMapping, hashCode, hasSimpleDatastoreRepresentation, includeInFetchStatement, includeInInsertStatement, includeInUpdateStatement, initialize, isNullable, isSerialised, representableAsStringLiteralInStatement, setAbsFieldNumber, setBoolean, setByte, setChar, setDouble, setFloat, setInt, setLong, setMemberMetaData, setReferenceMapping, setRoleForMember, setShort, setString, setTablepublic static final int PER_IMPLEMENTATION_MAPPING
public static final int ID_MAPPING
public static final int XCALIA_MAPPING
protected int mappingStrategy
public void initialize(org.datanucleus.metadata.AbstractMemberMetaData mmd,
Table table,
org.datanucleus.ClassLoaderResolver clr)
initialize in class JavaTypeMappingmmd - AbstractMemberMetaData for the field to be mapped (if any)table - The datastore container storing this mapping (if any)clr - the ClassLoaderResolverpublic int getMappingStrategy()
public JavaTypeMapping getJavaTypeMappingForType(Class type)
type - The implementation type we want the submapping forprotected void prepareColumnMapping(org.datanucleus.ClassLoaderResolver clr)
clr - The ClassLoaderResolverpublic String getJavaTypeForColumnMapping(int index)
getJavaTypeForColumnMapping in class JavaTypeMappingindex - requested column index.public int getMappingNumberForValue(org.datanucleus.ExecutionContext ec,
Object value)
getMappingNumberForValue in class MultiPersistableMappingec - ExecutionContextvalue - The valuepublic void setObject(org.datanucleus.ExecutionContext ec,
PreparedStatement ps,
int[] pos,
Object value,
org.datanucleus.state.ObjectProvider ownerOP,
int ownerFieldNumber)
setObject in class MultiPersistableMappingec - the ExecutionContextps - a datastore object that executes statements in the databasepos - The position(s) of the PreparedStatement to populatevalue - the value stored in this fieldownerOP - the owner ObjectProviderownerFieldNumber - the owner absolute field numberpublic Object getObject(org.datanucleus.ExecutionContext ec, ResultSet rs, int[] pos)
getObject in class MultiPersistableMappingec - ExecutionContextrs - The ResultSetpos - The parameter positionspublic Class getJavaType()
JavaTypeMappinggetJavaType in class JavaTypeMappingprotected String getReferenceStringForObject(org.datanucleus.ExecutionContext ec, Object value)
ec - ExecutionContextvalue - The objectprotected Object getObjectForReferenceString(org.datanucleus.ExecutionContext ec, String refString)
ec - execution contextrefString - The reference stringpublic void postFetch(org.datanucleus.state.ObjectProvider op)
postFetch in interface MappingCallbacksop - ObjectProvider for the owner.public void insertPostProcessing(org.datanucleus.state.ObjectProvider op)
insertPostProcessing in interface MappingCallbacksop - ObjectProvider for the owner.public void postInsert(org.datanucleus.state.ObjectProvider op)
postInsert in interface MappingCallbacksop - ObjectProvider for the owner.public void postUpdate(org.datanucleus.state.ObjectProvider op)
postUpdate in interface MappingCallbacksop - ObjectProvider for the owner.public void preDelete(org.datanucleus.state.ObjectProvider op)
preDelete in interface MappingCallbacksop - ObjectProvider for the owner.Copyright © 2020. All rights reserved.