Class 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 Detail

      • mapping

        protected Mapping mapping
      • sourceObject

        protected Object sourceObject
      • targetClass

        protected Class targetClass
      • primaryKey

        protected Object primaryKey
      • primaryKeyMap

        protected HashMap primaryKeyMap
    • Constructor Detail

      • 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 Detail

      • getContainer

        public 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 HashMap getPrimaryKeyMap()
        Return the map of primary key/values required to lookup the reference class in the cache.
        Returns:
      • getPrimaryKey

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

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

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

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