Oracle Application Server TopLink API Reference
10g (9.0.4)

B10491-01

oracle.toplink.sdk
Class SDKDirectCollectionMapping

java.lang.Object
  |
  +--oracle.toplink.mappings.DatabaseMapping
        |
        +--oracle.toplink.sdk.SDKDirectCollectionMapping
All Implemented Interfaces:
java.lang.Cloneable, ContainerMapping, SDKCollectionMapping, java.io.Serializable
Direct Known Subclasses:
ArrayMapping

public class SDKDirectCollectionMapping
extends DatabaseMapping
implements SDKCollectionMapping

SDKDirectCollectionMapping 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 database row for the containing object. (Sorta like a DirectCollectionMapping without the additional table.)

Since:
TOPLink/Java 3.0
See Also:
SDKDescriptor, SDKFieldValue, SDKCollectionMappingHelper, SDKCollectionChangeRecord, SDKOrderedCollectionChangeRecord, Serialized Form

Constructor Summary
SDKDirectCollectionMapping()
          Default constructor.

 

Method Summary
 java.lang.Class getAttributeElementClass()
          PUBLIC: Return the class each element in the object's collection should be converted to, before the collection is inserted into the object.
 java.lang.String getElementDataTypeName()
          PUBLIC: Return the "data type" associated with each element in the nested collection.
 java.lang.Class getFieldElementClass()
          PUBLIC: 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()
          PUBLIC: Return the name of the field that holds the nested collection.
 void setAttributeElementClass(java.lang.Class attributeElementClass)
          PUBLIC: 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 setElementDataTypeName(java.lang.String elementDataTypeName)
          PUBLIC: Set the "data type" associated with each element in the nested collection.
 void setFieldElementClass(java.lang.Class fieldElementClass)
          PUBLIC: Set the class each element in the database row's collection should be converted to, before the collection is inserted into the database.
 void setFieldName(java.lang.String fieldName)
          PUBLIC: Set the name of the field that holds the nested collection.
 void simpleAddToCollectionChangeRecord(java.lang.Object referenceKey, java.lang.Object changeSetToAdd, oracle.toplink.internal.sessions.ObjectChangeSet changeSet, oracle.toplink.publicinterface.Session 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.publicinterface.Session 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)
          PUBLIC: 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)
          PUBLIC: SDKDirectCollectionMapping does not support Map containers.

 

Methods inherited from class oracle.toplink.mappings.DatabaseMapping
getAttributeClassification, getAttributeName, getGetMethodName, getSetMethodName, readOnly, readWrite, setAttributeName, setGetMethodName, setIsReadOnly, setSetMethodName, setWeight

 

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

 

Methods inherited from interface oracle.toplink.sdk.SDKCollectionMapping
getAttributeName, setRealAttributeValueInObject

 

Constructor Detail

SDKDirectCollectionMapping

public SDKDirectCollectionMapping()
Default constructor.
Method Detail

getAttributeElementClass

public java.lang.Class getAttributeElementClass()
PUBLIC: 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.

getElementDataTypeName

public java.lang.String getElementDataTypeName()
PUBLIC: Return the "data type" associated with each element in the nested collection. Depending on the data store, this could be optional.

getFieldElementClass

public java.lang.Class getFieldElementClass()
PUBLIC: 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()
PUBLIC: Return the name of the field that holds the nested collection.

setAttributeElementClass

public void setAttributeElementClass(java.lang.Class attributeElementClass)
PUBLIC: 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

setElementDataTypeName

public void setElementDataTypeName(java.lang.String elementDataTypeName)
PUBLIC: Set the "data type" associated with each element in the nested collection. Depending on the data store, this could be optional.

setFieldElementClass

public void setFieldElementClass(java.lang.Class fieldElementClass)
PUBLIC: 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.

setFieldName

public void setFieldName(java.lang.String fieldName)
PUBLIC: Set the name of the field that holds the nested collection.

simpleAddToCollectionChangeRecord

public void simpleAddToCollectionChangeRecord(java.lang.Object referenceKey,
                                              java.lang.Object changeSetToAdd,
                                              oracle.toplink.internal.sessions.ObjectChangeSet changeSet,
                                              oracle.toplink.publicinterface.Session 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.publicinterface.Session 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)
PUBLIC: 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)
PUBLIC: SDKDirectCollectionMapping does not support Map containers. It supports only Collection containers.
Specified by:
useMapClass in interface ContainerMapping

Copyright © 2003 Oracle Corporation. All Rights Reserved.