org.datanucleus.store.mapped.mapping
Class PersistableIdMapping

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.PersistableMapping
              extended by org.datanucleus.store.mapped.mapping.PersistableIdMapping
All Implemented Interfaces:
MappingCallbacks

public class PersistableIdMapping
extends PersistableMapping

Maps to identity objects of persistable values. Used only from within JDOQL queries on JDOHelper.getObjectId expressions


Field Summary
 
Fields inherited from class org.datanucleus.store.mapped.mapping.PersistableMapping
cmd
 
Fields inherited from class org.datanucleus.store.mapped.mapping.MultiMapping
javaTypeMappings, numberOfDatastoreMappings
 
Fields inherited from class org.datanucleus.store.mapped.mapping.JavaTypeMapping
absFieldNumber, datastoreContainer, datastoreMappings, LOCALISER, mmd, referenceMapping, roleForMember, storeMgr, type
 
Constructor Summary
PersistableIdMapping(PersistableMapping pcMapping)
          Constructor used to generate a PCMapping representing only the identity of the object.
 
Method Summary
 Object getObject(ExecutionContext ec, Object rs, int[] param)
          Returns an identity for a persistable class.
 void setObject(ExecutionContext ec, Object ps, int[] param, Object value)
          Method to set the object based on an input identity.
 
Methods inherited from class org.datanucleus.store.mapped.mapping.PersistableMapping
getJavaType, getValueForDatastoreMapping, initialize, insertPostProcessing, 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, getAbsoluteFieldNumber, getBoolean, getByte, getChar, getColumnMetaDataForMember, getDatastoreContainer, getDouble, getFloat, getInt, getJavaTypeForDatastoreMapping, getLong, getMemberMetaData, getObject, getReferenceMapping, getRoleForMember, getShort, getStoreManager, getString, getType, hashCode, hasSimpleDatastoreRepresentation, includeInFetchStatement, includeInInsertStatement, includeInUpdateStatement, initialize, isNullable, isSerialised, representableAsStringLiteralInStatement, setAbsFieldNumber, 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
 

Constructor Detail

PersistableIdMapping

public PersistableIdMapping(PersistableMapping pcMapping)
Constructor used to generate a PCMapping 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:
pcMapping - The mapping to base it on
Method Detail

getObject

public Object getObject(ExecutionContext ec,
                        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 PersistableMapping
Parameters:
ec - The ExecutionContext
rs - The ResultSet
param - Array of parameter ids in the ResultSet to retrieve
Returns:
The identity of the Persistence Capable object

setObject

public void setObject(ExecutionContext ec,
                      Object ps,
                      int[] param,
                      Object value)
Method to set the object based on an input identity.

Overrides:
setObject in class PersistableMapping
Parameters:
ec - ExecutionContext
ps - PreparedStatement
param - Parameter positions to populate when setting the value
value - The identity


Copyright © 2012. All Rights Reserved.