org.datanucleus.store.mapped.mapping
Class ReferenceIdMapping

java.lang.Object
  extended by org.datanucleus.store.mapped.mapping.JavaTypeMapping
      extended by org.datanucleus.store.mapped.mapping.MultiMapping
          extended by org.datanucleus.store.mapped.mapping.ReferenceMapping
              extended by 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


Field Summary
 
Fields inherited from class org.datanucleus.store.mapped.mapping.ReferenceMapping
ID_MAPPING, LOCALISER_MAPPED, mappingStrategy, PER_IMPLEMENTATION_MAPPING, XCALIA_MAPPING
 
Fields inherited from class org.datanucleus.store.mapped.mapping.MultiMapping
javaTypeMappings, numberOfDatastoreMappings
 
Fields inherited from class org.datanucleus.store.mapped.mapping.JavaTypeMapping
datastoreContainer, datastoreMappings, LOCALISER, mmd, referenceMapping, roleForMember, storeMgr, type
 
Constructor Summary
ReferenceIdMapping(ReferenceMapping refMapping)
          Constructor used to generate a ReferenceMapping representing only the identity of the object.
 
Method Summary
 java.lang.Object getObject(ObjectManager om, java.lang.Object rs, int[] param)
          Returns an identity for a persistable class.
 void setObject(ObjectManager om, 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, getSampleValue, initialize, insertPostProcessing, newLiteral, newScalarExpression, postFetch, postInsert, postUpdate, preDelete, prepareDatastoreMapping, setObject
 
Methods inherited from class org.datanucleus.store.mapped.mapping.MultiMapping
addJavaTypeMapping, getDatastoreMapping, getDatastoreMappings, getJavaTypeMapping, getNumberOfDatastoreMappings
 
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, setDefault, 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
 

Constructor Detail

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
Method Detail

getObject

public java.lang.Object getObject(ObjectManager om,
                                  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:
om - The ObjectManager
rs - The ResultSet
param - Array of parameter ids in the ResultSet to retrieve
Returns:
The id of the PC object.

setObject

public void setObject(ObjectManager om,
                      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:
om - ObjectManager
ps - PreparedStatement
param - Parameter positions to populate when setting the value
value - The identity


Copyright © 2010. All Rights Reserved.