Oracle Fusion Middleware Java API Reference for Oracle TopLink
11g Release 1 (11.1.1)

B32476-03

oracle.toplink.ox.mappings
Class XMLCollectionReferenceMapping

java.lang.Object
  extended by oracle.toplink.mappings.DatabaseMapping
      extended by oracle.toplink.mappings.AggregateMapping
          extended by oracle.toplink.ox.mappings.XMLObjectReferenceMapping
              extended by oracle.toplink.ox.mappings.XMLCollectionReferenceMapping
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, ContainerMapping, oracle.toplink.ox.mappings.XMLMapping

public class XMLCollectionReferenceMapping
extends XMLObjectReferenceMapping
implements ContainerMapping

TopLink OXM version of a 1-M mapping. A list of source-target key field associations is used to link the source xpaths to their related target xpaths, and hence their primary key (unique identifier) values used when (un)marshalling. It is important to note that each target xpath is assumed to be set as a primary key field on the target (reference) class descriptor - this is necessary in order to locate the correct target object instance in the session cache when resolving mapping references. The usesSingleNode flag should be set to true if the keys are to be written out in space-separated lists.

See Also:
XMLObjectReferenceMapping, ContainerMapping, Serialized Form

Constructor Summary
XMLCollectionReferenceMapping()
          The default constructor initializes the sourceToTargetKeyFieldAssociations and sourceToTargetKeys data structures.
 
Method Summary
 void setContainerPolicy(oracle.toplink.internal.queryframework.ContainerPolicy containerPolicy)
          ADVANCED: Set the mapping's containerPolicy.
 void setUsesSingleNode(boolean useSingleNode)
           
 void useCollectionClass(java.lang.Class concreteContainerClass)
          Configure the mapping to use an instance of the specified container class to hold the target objects.
 void useCollectionClassName(java.lang.String concreteContainerClassName)
           
 void useMapClass(java.lang.Class concreteContainerClass, java.lang.String methodName)
          Configure the mapping to use an instance of the specified container class to hold the target objects.
 
Methods inherited from class oracle.toplink.ox.mappings.XMLObjectReferenceMapping
addSourceToTargetKeyFieldAssociation, setField
 
Methods inherited from class oracle.toplink.mappings.AggregateMapping
getReferenceClass, setReferenceClass
 
Methods inherited from class oracle.toplink.mappings.DatabaseMapping
getAttributeAccessor, getAttributeClassification, getAttributeName, getGetMethodName, getProperty, getSetMethodName, isLazy, isOptional, isUsingMethodAccess, readOnly, readWrite, setAttributeAccessor, setAttributeName, setGetMethodName, setIsLazy, setIsOptional, setIsReadOnly, setProperty, setSetMethodName, setWeight, simpleAddToCollectionChangeRecord, simpleRemoveFromCollectionChangeRecord
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XMLCollectionReferenceMapping

public XMLCollectionReferenceMapping()
The default constructor initializes the sourceToTargetKeyFieldAssociations and sourceToTargetKeys data structures.

Method Detail

setContainerPolicy

public void setContainerPolicy(oracle.toplink.internal.queryframework.ContainerPolicy containerPolicy)
ADVANCED: Set the mapping's containerPolicy.

Specified by:
setContainerPolicy in interface ContainerMapping

useCollectionClass

public void useCollectionClass(java.lang.Class concreteContainerClass)
Configure the mapping to use an instance of the specified container class to hold the target objects.

jdk1.2.x: The container class must implement (directly or indirectly) the Collection interface.

jdk1.1.x: The container class must be a subclass of Vector.

Specified by:
useCollectionClass in interface ContainerMapping

useCollectionClassName

public void useCollectionClassName(java.lang.String concreteContainerClassName)

useMapClass

public void useMapClass(java.lang.Class concreteContainerClass,
                        java.lang.String methodName)
Configure the mapping to use an instance of the specified container class to hold the target objects. The key used to index the value in the Map is the value returned by a call to the specified zero-argument method. The method must be implemented by the class (or a superclass) of the value to be inserted into the Map.

jdk1.2.x: The container class must implement (directly or indirectly) the Map interface.

jdk1.1.x: The container class must be a subclass of Hashtable.

The referenceClass must be set before calling this method.

Specified by:
useMapClass in interface ContainerMapping

setUsesSingleNode

public void setUsesSingleNode(boolean useSingleNode)

Copyright © 1998, 2010, Oracle. All Rights Reserved.