Class PersistableIdMapping

All Implemented Interfaces:
MappingCallbacks

public class PersistableIdMapping extends PersistableMapping
Maps to identity objects of persistable values. Used within JDOQL queries on JDOHelper.getObjectId expressions, as well as on SQL statement results when selecting a PersistableMapping to convert to an identity.
  • Constructor Details

    • PersistableIdMapping

      public PersistableIdMapping(PersistableMapping pcMapping)
      Constructor used to generate a mapping representing only the identity of the persistable object.
      Parameters:
      pcMapping - The persistable 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 PersistableMapping
      Parameters:
      ec - The ExecutionContext
      rs - The ResultSet
      param - Array of parameter ids in the ResultSet to retrieve
      Returns:
      The identity of the Persistence Capable 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 PersistableMapping
      Parameters:
      ec - ExecutionContext
      ps - PreparedStatement
      param - Parameter positions to populate when setting the value
      value - The identity