Class ReferenceIdMapping
java.lang.Object
org.datanucleus.store.rdbms.mapping.java.JavaTypeMapping
org.datanucleus.store.rdbms.mapping.java.MultiMapping
org.datanucleus.store.rdbms.mapping.java.MultiPersistableMapping
org.datanucleus.store.rdbms.mapping.java.ReferenceMapping
org.datanucleus.store.rdbms.mapping.java.ReferenceIdMapping
- All Implemented Interfaces:
MappingCallbacks
Maps to identity objects of reference values.
Used only from within JDOQL queries on JDOHelper.getObjectId expressions
-
Field Summary
Fields inherited from class ReferenceMapping
ID_MAPPING, mappingStrategy, PER_IMPLEMENTATION_MAPPING, XCALIA_MAPPINGFields inherited from class MultiMapping
javaTypeMappings, numberOfColumnMappingsFields inherited from class JavaTypeMapping
absFieldNumber, columnMappings, mmd, referenceMapping, roleForMember, storeMgr, table, type -
Constructor Summary
ConstructorsConstructorDescriptionReferenceIdMapping(ReferenceMapping refMapping) Constructor used to generate a ReferenceMapping representing only the identity of the object. -
Method Summary
Modifier and TypeMethodDescriptionReturns an identity for a persistable class.voidsetObject(org.datanucleus.ExecutionContext ec, PreparedStatement ps, int[] param, Object value) Method to set the object based on an input identity.Methods inherited from class ReferenceMapping
createPerImplementationColumnsForReferenceField, getJavaType, getJavaTypeForColumnMapping, getJavaTypeMappingForType, getMappingNumberForValue, getMappingStrategy, getObjectForReferenceString, getReferenceStringForObject, initialize, preDelete, prepareColumnMapping, setObjectMethods inherited from class MultiMapping
addJavaTypeMapping, getColumnMapping, getColumnMappings, getJavaTypeMapping, getNumberOfColumnMappingsMethods inherited from class JavaTypeMapping
addColumnMapping, 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, performSetPostProcessing, representableAsStringLiteralInStatement, requiresSetPostProcessing, setAbsFieldNumber, setBoolean, setByte, setChar, setDouble, setFloat, setInt, setLong, setMemberMetaData, setReferenceMapping, setRoleForMember, setShort, setString, setTableMethods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface MappingCallbacks
postFetch, postInsert, postUpdate
-
Constructor Details
-
ReferenceIdMapping
Constructor used to generate a ReferenceMapping representing only the identity of the object. This is typically used where the user has selected the id in a JDOQL query as a result field.- Parameters:
refMapping- The mapping to base it on
-
-
Method Details
-
getObject
Returns an identity for a persistable class. Processes a FK field and finds the object that it relates to, then returns the identity.- Overrides:
getObjectin classReferenceMapping- Parameters:
ec- execution contextrs- The ResultSetparam- Array of parameter ids in the ResultSet to retrieve- Returns:
- The id of the PC object.
-
setObject
public void setObject(org.datanucleus.ExecutionContext ec, PreparedStatement ps, int[] param, Object value) Method to set the object based on an input identity.- Overrides:
setObjectin classMultiPersistableMapping- Parameters:
ec- execution contextps- PreparedStatementparam- Parameter positions to populate when setting the valuevalue- The identity
-