Class SerialisedPCMapping

Direct Known Subclasses:
SerialisedElementPCMapping, SerialisedKeyPCMapping, SerialisedValuePCMapping

public class SerialisedPCMapping extends SerialisedMapping
Mapping for a serialised persistable object. Extends ObjectMapping since that provides the basic serialisation mechanism, adding on the addition of StateManagers to the serialised object whenever it is required.
  • Constructor Details

    • SerialisedPCMapping

      public SerialisedPCMapping()
  • Method Details

    • setObject

      public void setObject(org.datanucleus.ExecutionContext ec, PreparedStatement ps, int[] exprIndex, Object value)
      Method to populate parameter positions in a PreparedStatement with this object
      Overrides:
      setObject in class SingleFieldMapping
      Parameters:
      ec - The ExecutionContext
      ps - 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(org.datanucleus.ExecutionContext ec, PreparedStatement ps, int[] exprIndex, Object value, org.datanucleus.state.DNStateManager ownerSM, int fieldNumber)
      Method to populate parameter positions in a PreparedStatement with this object
      Overrides:
      setObject in class JavaTypeMapping
      Parameters:
      ec - The ExecutionContext
      ps - The Prepared Statement
      exprIndex - The parameter positions to populate
      value - The value of the PC to use in populating the parameter positions
      ownerSM - StateManager for the owning object
      fieldNumber - field number of this object in the owning object
    • getObject

      public Object getObject(org.datanucleus.ExecutionContext ec, ResultSet resultSet, int[] exprIndex)
      Method to extract the value of the persistable from a ResultSet.
      Overrides:
      getObject in class SingleFieldMapping
      Parameters:
      ec - The ExecutionContext
      resultSet - The ResultSet
      exprIndex - The parameter positions in the result set to use.
      Returns:
      The (deserialised) persistable object
    • getObject

      public Object getObject(org.datanucleus.ExecutionContext ec, ResultSet resultSet, int[] exprIndex, org.datanucleus.state.DNStateManager ownerSM, int fieldNumber)
      Method to extract the value of the persistable from a ResultSet.
      Overrides:
      getObject in class JavaTypeMapping
      Parameters:
      ec - The ExecutionContext
      resultSet - The ResultSet
      exprIndex - The parameter positions in the result set to use.
      ownerSM - StateManager for the owning object
      fieldNumber - Absolute number of field in owner object
      Returns:
      The (deserialised) persistable object