java.lang.Object
org.eclipse.persistence.internal.oxm.Reference

public class Reference extends Object
INTERNAL:

Purpose: Holds mapping reference info. The info held in this class will be used after unmarshal to resolve 1-1 and 1-M mapping references. This is necessary to ensure that all related objects have been created before attempting to set instance values in related objects.

  • Field Details

    • mapping

      protected Mapping mapping
    • sourceObject

      protected Object sourceObject
    • targetClass

      protected Class<?> targetClass
    • primaryKey

      protected Object primaryKey
    • primaryKeyMap

      protected HashMap primaryKeyMap
  • Constructor Details

    • Reference

      public Reference(Mapping mapping, Object source, Class<?> target, HashMap primaryKeyMap, Object container)
      Constructor typically used in the collection case.
    • Reference

      public Reference(Mapping mapping, Object source, Class<?> target, Object primaryKey)
      Constructor typically used in the single case.
  • Method Details

    • getContainer

      public Object getContainer()
      Get the container this reference should be added to if it was from a collection mapping
    • getSetting

      public Setting getSetting()
    • setSetting

      public void setSetting(Setting setting)
    • getMapping

      public Mapping getMapping()
      Return the XMLMapping associated with this reference.
    • getPrimaryKeyMap

      public HashMap getPrimaryKeyMap()
      Return the map of primary key/values required to lookup the reference class in the cache.
    • getPrimaryKey

      public Object getPrimaryKey()
      Return the list of primary key values required to lookup the reference class in the cache.
    • getSourceObject

      public Object getSourceObject()
      Return the source object for this reference.
    • getTargetClass

      public Class<?> getTargetClass()
      Return the target (reference) class for this reference.
    • setPrimaryKey

      public void setPrimaryKey(Object primaryKey)
      Set the primary key value required to lookup the reference class in the cache.