Class Reference
- java.lang.Object
-
- org.eclipse.persistence.internal.oxm.Reference
-
public class Reference extends java.lang.ObjectINTERNAL: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 Summary
Fields Modifier and Type Field Description protected Mappingmappingprotected java.lang.ObjectprimaryKeyprotected java.util.HashMapprimaryKeyMapprotected java.lang.ObjectsourceObjectprotected java.lang.ClasstargetClass
-
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.ObjectgetContainer()Get the container this reference should be added to if it was from a collection mappingMappinggetMapping()Return the XMLMapping associated with this reference.java.lang.ObjectgetPrimaryKey()Return the list of primary key values required to lookup the reference class in the cache.java.util.HashMapgetPrimaryKeyMap()Return the map of primary key/values required to lookup the reference class in the cache.SettinggetSetting()java.lang.ObjectgetSourceObject()Return the source object for this reference.java.lang.ClassgetTargetClass()Return the target (reference) class for this reference.voidsetPrimaryKey(java.lang.Object primaryKey)Set the primary key value required to lookup the reference class in the cache.voidsetSetting(Setting setting)
-
-
-
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.
-
-