org.datanucleus.store.mapped.mapping
Class SerialisedPCMapping

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.SerialisedPCMapping
Direct Known Subclasses:
SerialisedElementPCMapping, SerialisedKeyPCMapping, SerialisedValuePCMapping

public class SerialisedPCMapping
extends SerialisedMapping

Mapping for a serialised PersistenceCapable object. Extends ObjectMapping since that provides the basic serialisation mechanism, adding on the addition of StateManagers to the serialised object whenever it is required.


Field Summary
 
Fields inherited from class org.datanucleus.store.mapped.mapping.JavaTypeMapping
datastoreContainer, datastoreMappings, LOCALISER, mmd, referenceMapping, roleForMember, storeMgr, type
 
Constructor Summary
SerialisedPCMapping()
           
 
Method Summary
 java.lang.Object getObject(ObjectManager om, java.lang.Object resultSet, int[] exprIndex)
          Method to extract the value of the PersistenceCapable from a ResultSet.
 java.lang.Object getObject(ObjectManager om, java.lang.Object resultSet, int[] exprIndex, StateManager ownerSM, int fieldNumber)
          Method to extract the value of the PersistenceCapable from a ResultSet.
 void setObject(ObjectManager om, java.lang.Object preparedStatement, int[] exprIndex, java.lang.Object value)
          Method to populate parameter positions in a PreparedStatement with this object
 void setObject(ObjectManager om, java.lang.Object preparedStatement, int[] exprIndex, java.lang.Object value, StateManager 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, getSampleValue, newLiteral, newScalarExpression
 
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, setDefault, setMemberMetaData, setReferenceMapping, setRoleForMember
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SerialisedPCMapping

public SerialisedPCMapping()
Method Detail

setObject

public void setObject(ObjectManager om,
                      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:
om - The Object Manager
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(ObjectManager om,
                      java.lang.Object preparedStatement,
                      int[] exprIndex,
                      java.lang.Object value,
                      StateManager ownerSM,
                      int fieldNumber)
Method to populate parameter positions in a PreparedStatement with this object

Overrides:
setObject in class JavaTypeMapping
Parameters:
om - The Object Manager
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(ObjectManager om,
                                  java.lang.Object resultSet,
                                  int[] exprIndex)
Method to extract the value of the PersistenceCapable from a ResultSet.

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

getObject

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

Overrides:
getObject in class JavaTypeMapping
Parameters:
om - The ObjectManager
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 © 2010. All Rights Reserved.