org.datanucleus.store.mapped.mapping
Class ReferenceIdMapping
java.lang.Object
org.datanucleus.store.mapped.mapping.JavaTypeMapping
org.datanucleus.store.mapped.mapping.MultiMapping
org.datanucleus.store.mapped.mapping.ReferenceMapping
org.datanucleus.store.mapped.mapping.ReferenceIdMapping
- All Implemented Interfaces:
- MappingCallbacks
public class ReferenceIdMapping
- extends ReferenceMapping
Maps to identity objects of reference values.
Used only from within JDOQL queries on JDOHelper.getObjectId expressions
|
Method Summary |
java.lang.Object |
getObject(ExecutionContext ec,
java.lang.Object rs,
int[] param)
Returns an identity for a persistable class. |
void |
setObject(ExecutionContext ec,
java.lang.Object ps,
int[] param,
java.lang.Object value)
Method to set the object based on an input identity. |
| Methods inherited from class org.datanucleus.store.mapped.mapping.ReferenceMapping |
getJavaType, getJavaTypeForDatastoreMapping, getMappingNumberForValue, getMappingStrategy, getObjectForReferenceString, getReferenceStringForObject, initialize, insertPostProcessing, postFetch, postInsert, postUpdate, preDelete, prepareDatastoreMapping, setObject |
| Methods inherited from class org.datanucleus.store.mapped.mapping.JavaTypeMapping |
addDatastoreMapping, equals, failureMessage, getBoolean, getByte, getChar, getColumnMetaDataForMember, getDatastoreContainer, getDouble, getFloat, getInt, getLong, getMemberMetaData, getObject, getReferenceMapping, getRoleForMember, getShort, getString, getType, getValueForDatastoreMapping, hashCode, hasSimpleDatastoreRepresentation, includeInFetchStatement, includeInInsertStatement, includeInUpdateStatement, initialize, isNullable, isSerialised, setBoolean, setByte, setChar, setDatastoreContainer, setDouble, setFloat, setInt, setLong, setMemberMetaData, setReferenceMapping, setRoleForMember, setShort, setString |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
ReferenceIdMapping
public ReferenceIdMapping(ReferenceMapping refMapping)
- 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
getObject
public java.lang.Object getObject(ExecutionContext ec,
java.lang.Object rs,
int[] param)
- Returns an identity for a persistable class.
Processes a FK field and finds the object that it relates to, then returns the identity.
- Overrides:
getObject in class ReferenceMapping
- 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(ExecutionContext ec,
java.lang.Object ps,
int[] param,
java.lang.Object value)
- Method to set the object based on an input identity.
- Overrides:
setObject in class MultiMapping
- Parameters:
ec - execution contextps - PreparedStatementparam - Parameter positions to populate when setting the valuevalue - The identity
Copyright © 2011. All Rights Reserved.