Class 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 persistable).
  • Constructor Details

    • SerialisedReferenceMapping

      public SerialisedReferenceMapping()
  • 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 - execution context
      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 - execution context
      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 - execution context
      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 - execution context
      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