Class ReferenceIdMapping

All Implemented Interfaces:
MappingCallbacks

public class ReferenceIdMapping extends ReferenceMapping
Maps to identity objects of reference values. Used only from within JDOQL queries on JDOHelper.getObjectId expressions
  • Constructor Details

    • ReferenceIdMapping

      public ReferenceIdMapping(ReferenceMapping refMapping)
      Constructor used to generate a ReferenceMapping 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:
      refMapping - The mapping to base it on
  • Method Details

    • getObject

      public Object getObject(org.datanucleus.ExecutionContext ec, ResultSet 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 ReferenceMapping
      Parameters:
      ec - execution context
      rs - The ResultSet
      param - Array of parameter ids in the ResultSet to retrieve
      Returns:
      The id of the PC object.
    • setObject

      public void setObject(org.datanucleus.ExecutionContext ec, PreparedStatement ps, int[] param, Object value)
      Method to set the object based on an input identity.
      Overrides:
      setObject in class MultiPersistableMapping
      Parameters:
      ec - execution context
      ps - PreparedStatement
      param - Parameter positions to populate when setting the value
      value - The identity