Skip navigation links

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

B32476-02


oracle.toplink.mappings.foundation
Class AbstractCompositeDirectCollectionMapping

java.lang.Object
  extended by oracle.toplink.mappings.DatabaseMapping
      extended by oracle.toplink.mappings.foundation.AbstractCompositeDirectCollectionMapping

All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, ContainerMapping
Direct Known Subclasses:
EISCompositeDirectCollectionMapping, SDKDirectCollectionMapping, XMLCompositeDirectCollectionMapping, XMLFragmentCollectionMapping

public abstract class AbstractCompositeDirectCollectionMapping
extends DatabaseMapping
implements ContainerMapping

AbstractCompositeDirectCollectionMapping consolidates the behavior of mappings that map collections of "native" data objects (e.g. Strings). These are objects that do not have their own descriptor and repeat within the XML record for the containing object.

Since:
TOPLink/Java 3.0
See Also:
Serialized Form

Constructor Summary
AbstractCompositeDirectCollectionMapping()
          Default constructor.

 

Method Summary
 java.lang.Class getAttributeElementClass()
          Return the class each element in the object's collection should be converted to, before the collection is inserted into the object.
 java.lang.Class getFieldElementClass()
          Return the class each element in the database row's collection should be converted to, before the collection is inserted into the database.
 java.lang.String getFieldName()
          Return the name of the field that holds the nested collection.
 Converter getValueConverter()
          Return the converter on the mapping.
 boolean hasValueConverter()
          Indicates if there is a converter on the mapping.
 void setAttributeElementClass(java.lang.Class attributeElementClass)
          Set the class each element in the object's collection should be converted to, before the collection is inserted into the object.
 void setContainerPolicy(oracle.toplink.internal.queryframework.ContainerPolicy containerPolicy)
          ADVANCED: Set the mapping's containerPolicy.
 void setField(DatabaseField field)
          Set the field that holds the nested collection.
 void setFieldElementClass(java.lang.Class fieldElementClass)
          Set the class each element in the database row's collection should be converted to, before the collection is inserted into the database.
 void setUsesSingleNode(boolean usesSingleNode)
          Sets whether the mapping uses a single node.
 void setValueConverter(Converter valueConverter)
          Set the converter on the mapping.
 void simpleAddToCollectionChangeRecord(java.lang.Object referenceKey, java.lang.Object changeSetToAdd, oracle.toplink.internal.sessions.ObjectChangeSet changeSet, oracle.toplink.internal.sessions.AbstractSession session)
          ADVANCED: This method is used to have an object add to a collection once the changeSet is applied The referenceKey parameter should only be used for direct Maps.
 void simpleRemoveFromCollectionChangeRecord(java.lang.Object referenceKey, java.lang.Object changeSetToRemove, oracle.toplink.internal.sessions.ObjectChangeSet changeSet, oracle.toplink.internal.sessions.AbstractSession session)
          ADVANCED: This method is used to have an object removed from a collection once the changeSet is applied The referenceKey parameter should only be used for direct Maps.
 void useCollectionClass(java.lang.Class concreteClass)
          Configure the mapping to use an instance of the specified container class to hold the nested objects.
 void useMapClass(java.lang.Class concreteClass, java.lang.String methodName)
          Mapping does not support Map containers.
 boolean usesSingleNode()
          Checks whether the mapping uses a single node.

 

Methods inherited from class oracle.toplink.mappings.DatabaseMapping
getAttributeAccessor, getAttributeClassification, getAttributeName, getGetMethodName, getProperty, getReferenceDescriptor, getSetMethodName, isLazy, isOptional, isUsingMethodAccess, readOnly, readWrite, setAttributeAccessor, setAttributeName, setGetMethodName, setIsLazy, setIsOptional, setIsReadOnly, setProperty, setSetMethodName, setWeight

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

 

Constructor Detail

AbstractCompositeDirectCollectionMapping

public AbstractCompositeDirectCollectionMapping()
Default constructor.

Method Detail

getValueConverter

public Converter getValueConverter()
Return the converter on the mapping. A converter can be used to convert between the direct collection's object value and database value.

hasValueConverter

public boolean hasValueConverter()
Indicates if there is a converter on the mapping.

setValueConverter

public void setValueConverter(Converter valueConverter)
Set the converter on the mapping. A converter can be used to convert between the direct collection's object value and database value.

getAttributeElementClass

public java.lang.Class getAttributeElementClass()
Return the class each element in the object's collection should be converted to, before the collection is inserted into the object. This is optional - if left null, the elements will be added to the object's collection unconverted.

getFieldElementClass

public java.lang.Class getFieldElementClass()
Return the class each element in the database row's collection should be converted to, before the collection is inserted into the database. This is optional - if left null, the elements will be added to the database row's collection unconverted.

getFieldName

public java.lang.String getFieldName()
Return the name of the field that holds the nested collection.

setAttributeElementClass

public void setAttributeElementClass(java.lang.Class attributeElementClass)
Set the class each element in the object's collection should be converted to, before the collection is inserted into the object. This is optional - if left null, the elements will be added to the object's collection unconverted.

setContainerPolicy

public void setContainerPolicy(oracle.toplink.internal.queryframework.ContainerPolicy containerPolicy)
ADVANCED: Set the mapping's containerPolicy.
Specified by:
setContainerPolicy in interface ContainerMapping

setField

public void setField(DatabaseField field)
Set the field that holds the nested collection.

setFieldElementClass

public void setFieldElementClass(java.lang.Class fieldElementClass)
Set the class each element in the database row's collection should be converted to, before the collection is inserted into the database. This is optional - if left null, the elements will be added to the database row's collection unconverted.

simpleAddToCollectionChangeRecord

public void simpleAddToCollectionChangeRecord(java.lang.Object referenceKey,
                                              java.lang.Object changeSetToAdd,
                                              oracle.toplink.internal.sessions.ObjectChangeSet changeSet,
                                              oracle.toplink.internal.sessions.AbstractSession session)
ADVANCED: This method is used to have an object add to a collection once the changeSet is applied The referenceKey parameter should only be used for direct Maps.
Overrides:
simpleAddToCollectionChangeRecord in class DatabaseMapping

simpleRemoveFromCollectionChangeRecord

public void simpleRemoveFromCollectionChangeRecord(java.lang.Object referenceKey,
                                                   java.lang.Object changeSetToRemove,
                                                   oracle.toplink.internal.sessions.ObjectChangeSet changeSet,
                                                   oracle.toplink.internal.sessions.AbstractSession session)
ADVANCED: This method is used to have an object removed from a collection once the changeSet is applied The referenceKey parameter should only be used for direct Maps.
Overrides:
simpleRemoveFromCollectionChangeRecord in class DatabaseMapping

useCollectionClass

public void useCollectionClass(java.lang.Class concreteClass)
Configure the mapping to use an instance of the specified container class to hold the nested 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

useMapClass

public void useMapClass(java.lang.Class concreteClass,
                        java.lang.String methodName)
Mapping does not support Map containers. It supports only Collection containers.
Specified by:
useMapClass in interface ContainerMapping

setUsesSingleNode

public void setUsesSingleNode(boolean usesSingleNode)
Sets whether the mapping uses a single node.
Parameters:
True - if the items in the collection are in a single node or false if each of the items in the collection is in its own node

usesSingleNode

public boolean usesSingleNode()
Checks whether the mapping uses a single node.

Skip navigation links

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