Class Reference


  • public class Reference
    extends java.lang.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.

    • Constructor Summary

      Constructors 
      Constructor Description
      Reference​(Mapping mapping, java.lang.Object source, java.lang.Class target, java.lang.Object primaryKey)
      Constructor typically used in the single case.
      Reference​(Mapping mapping, java.lang.Object source, java.lang.Class target, java.util.HashMap primaryKeyMap, java.lang.Object container)
      Constructor typically used in the collection case.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object getContainer()
      Get the container this reference should be added to if it was from a collection mapping
      Mapping getMapping()
      Return the XMLMapping associated with this reference.
      java.lang.Object getPrimaryKey()
      Return the list of primary key values required to lookup the reference class in the cache.
      java.util.HashMap getPrimaryKeyMap()
      Return the map of primary key/values required to lookup the reference class in the cache.
      Setting getSetting()  
      java.lang.Object getSourceObject()
      Return the source object for this reference.
      java.lang.Class getTargetClass()
      Return the target (reference) class for this reference.
      void setPrimaryKey​(java.lang.Object primaryKey)
      Set the primary key value required to lookup the reference class in the cache.
      void setSetting​(Setting setting)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • mapping

        protected Mapping mapping
      • sourceObject

        protected java.lang.Object sourceObject
      • targetClass

        protected java.lang.Class targetClass
      • primaryKey

        protected java.lang.Object primaryKey
      • primaryKeyMap

        protected java.util.HashMap primaryKeyMap
    • Constructor Detail

      • Reference

        public Reference​(Mapping mapping,
                         java.lang.Object source,
                         java.lang.Class target,
                         java.util.HashMap primaryKeyMap,
                         java.lang.Object container)
        Constructor typically used in the collection case.
      • Reference

        public Reference​(Mapping mapping,
                         java.lang.Object source,
                         java.lang.Class target,
                         java.lang.Object primaryKey)
        Constructor typically used in the single case.
    • Method Detail

      • getContainer

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

        public Setting getSetting()
      • setSetting

        public void setSetting​(Setting setting)
      • getMapping

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

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

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

        public java.lang.Object getSourceObject()
        Return the source object for this reference.
        Returns:
      • getTargetClass

        public java.lang.Class getTargetClass()
        Return the target (reference) class for this reference.
        Returns:
      • setPrimaryKey

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