org.datanucleus.store.mapped.mapping
Class SerialisedReferenceMapping

java.lang.Object
  extended by org.datanucleus.store.mapped.mapping.JavaTypeMapping
      extended by org.datanucleus.store.mapped.mapping.SingleFieldMapping
          extended by org.datanucleus.store.mapped.mapping.SerialisedMapping
              extended by org.datanucleus.store.mapped.mapping.SerialisedReferenceMapping

public class SerialisedReferenceMapping
extends SerialisedMapping

Mapping for a serialised reference (Interface/Object) field. Extends SerialisedMapping since that provides the basic serialisation mechanism, adding on the addition of StateManagers to the serialised object whenever it is required (since the object is a PersistenceCapable).


Field Summary
 
Fields inherited from class org.datanucleus.store.mapped.mapping.JavaTypeMapping
datastoreContainer, datastoreMappings, LOCALISER, mmd, referenceMapping, roleForMember, storeMgr, type
 
Constructor Summary
SerialisedReferenceMapping()
           
 
Method Summary
 java.lang.Object getObject(ExecutionContext ec, java.lang.Object resultSet, int[] exprIndex)
          Method to extract the value of the PersistenceCapable from a ResultSet.
 java.lang.Object getObject(ExecutionContext ec, java.lang.Object resultSet, int[] exprIndex, ObjectProvider ownerSM, int fieldNumber)
          Method to extract the value of the PersistenceCapable from a ResultSet.
 void setObject(ExecutionContext ec, java.lang.Object preparedStatement, int[] exprIndex, java.lang.Object value)
          Method to populate parameter positions in a PreparedStatement with this object
 void setObject(ExecutionContext ec, java.lang.Object preparedStatement, int[] exprIndex, java.lang.Object value, ObjectProvider ownerSM, int fieldNumber)
          Method to populate parameter positions in a PreparedStatement with this object
 
Methods inherited from class org.datanucleus.store.mapped.mapping.SerialisedMapping
getJavaType, getJavaTypeForDatastoreMapping
 
Methods inherited from class org.datanucleus.store.mapped.mapping.SingleFieldMapping
equals, getBoolean, getByte, getChar, getDefaultLength, getDouble, getFloat, getInt, getLong, getShort, getString, getValidValues, initialize, prepareDatastoreMapping, setBoolean, setByte, setChar, setDouble, setFloat, setInt, setLong, setShort, setString
 
Methods inherited from class org.datanucleus.store.mapped.mapping.JavaTypeMapping
addDatastoreMapping, failureMessage, getColumnMetaDataForMember, getDatastoreContainer, getDatastoreMapping, getDatastoreMappings, getMemberMetaData, getNumberOfDatastoreMappings, getReferenceMapping, getRoleForMember, getType, getValueForDatastoreMapping, hashCode, hasSimpleDatastoreRepresentation, includeInFetchStatement, includeInInsertStatement, includeInUpdateStatement, initialize, isNullable, isSerialised, setDatastoreContainer, setMemberMetaData, setReferenceMapping, setRoleForMember
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SerialisedReferenceMapping

public SerialisedReferenceMapping()
Method Detail

setObject

public void setObject(ExecutionContext ec,
                      java.lang.Object preparedStatement,
                      int[] exprIndex,
                      java.lang.Object value)
Method to populate parameter positions in a PreparedStatement with this object

Overrides:
setObject in class SingleFieldMapping
Parameters:
ec - execution context
preparedStatement - The Prepared Statement
exprIndex - The parameter positions to populate
value - The value of the PC to use in populating the parameter positions

setObject

public void setObject(ExecutionContext ec,
                      java.lang.Object preparedStatement,
                      int[] exprIndex,
                      java.lang.Object value,
                      ObjectProvider ownerSM,
                      int fieldNumber)
Method to populate parameter positions in a PreparedStatement with this object

Overrides:
setObject in class JavaTypeMapping
Parameters:
ec - execution context
preparedStatement - The Prepared Statement
exprIndex - The parameter positions to populate
value - The value of the PC to use in populating the parameter positions
ownerSM - State Manager for the owning object
fieldNumber - field number of this object in the owning object

getObject

public java.lang.Object getObject(ExecutionContext ec,
                                  java.lang.Object resultSet,
                                  int[] exprIndex)
Method to extract the value of the PersistenceCapable from a ResultSet.

Overrides:
getObject in class SingleFieldMapping
Parameters:
ec - execution context
resultSet - The ResultSet
exprIndex - The parameter positions in the result set to use.
Returns:
The (deserialised) PersistenceCapable object

getObject

public java.lang.Object getObject(ExecutionContext ec,
                                  java.lang.Object resultSet,
                                  int[] exprIndex,
                                  ObjectProvider ownerSM,
                                  int fieldNumber)
Method to extract the value of the PersistenceCapable from a ResultSet.

Overrides:
getObject in class JavaTypeMapping
Parameters:
ec - execution context
resultSet - The ResultSet
exprIndex - The parameter positions in the result set to use.
ownerSM - The owning object
fieldNumber - Absolute number of field in owner object
Returns:
The (deserialised) PersistenceCapable object


Copyright © 2011. All Rights Reserved.