Oracle Application Server TopLink API Reference
10g (9.0.4.3)

B10491-02

oracle.toplink.sdk
Class SDKAggregateCollectionMapping

java.lang.Object
  extended byoracle.toplink.mappings.DatabaseMapping
      extended byoracle.toplink.mappings.AggregateMapping
          extended byoracle.toplink.sdk.SDKAggregateCollectionMapping

All Implemented Interfaces:
java.lang.Cloneable, ContainerMapping, SDKCollectionMapping, java.io.Serializable
Direct Known Subclasses:
ObjectArrayMapping

public class SDKAggregateCollectionMapping
extends AggregateMapping
implements SDKCollectionMapping

Chunks of data from non-relational data sources can have embedded collections of component objects. These can be mapped using this mapping. The format of the embedded data is determined by the reference descriptor.

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

Constructor Summary
SDKAggregateCollectionMapping()
          Default constructor.

 

Method Summary
 java.lang.Object buildAddedElementFromChangeSet(java.lang.Object changeSet, oracle.toplink.internal.sessions.MergeManager mergeManager)
          INTERNAL: Build and return a new element based on the change set.
 java.lang.Object buildChangeSet(java.lang.Object element, oracle.toplink.internal.sessions.ObjectChangeSet owner, oracle.toplink.publicinterface.Session session)
          INTERNAL: Build and return a change set for the specified element.
 java.lang.Object buildElementFromElement(java.lang.Object element, oracle.toplink.internal.sessions.MergeManager mergeManager)
          INTERNAL: Build and return a new element based on the specified element.
 java.lang.Object buildRemovedElementFromChangeSet(java.lang.Object changeSet, oracle.toplink.internal.sessions.MergeManager mergeManager)
          INTERNAL: Build and return a new element based on the change set.
 boolean compareElements(java.lang.Object element1, java.lang.Object element2, oracle.toplink.publicinterface.Session session)
          INTERNAL: Compare the non-null elements and return true if they are alike.
 boolean compareElementsForChange(java.lang.Object element1, java.lang.Object element2, oracle.toplink.publicinterface.Session session)
          INTERNAL: Compare the non-null elements and return true if they are alike.
 oracle.toplink.internal.sessions.ChangeRecord compareForChange(java.lang.Object clone, java.lang.Object backup, oracle.toplink.internal.sessions.ObjectChangeSet owner, oracle.toplink.publicinterface.Session session)
          INTERNAL: Build and return the change record that results from comparing the two aggregate collection attributes.
 boolean compareObjects(java.lang.Object object1, java.lang.Object object2, oracle.toplink.publicinterface.Session session)
          INTERNAL: Compare the attributes belonging to this mapping for the objects.
 oracle.toplink.internal.queryframework.ContainerPolicy getContainerPolicy()
          INTERNAL: Return the mapping's containerPolicy.
 oracle.toplink.internal.helper.DatabaseField getField()
          INTERNAL: Return the field mapped by this mapping.
 java.lang.String getFieldName()
          PUBLIC: Return the mapping's field name.
 java.lang.Object getRealCollectionAttributeValueFromObject(java.lang.Object object, oracle.toplink.publicinterface.Session session)
          INTERNAL: Convenience method.
 void initialize(oracle.toplink.publicinterface.Session session)
          INTERNAL: The mapping is initialized with the given session.
 boolean mapKeyHasChanged(java.lang.Object element, oracle.toplink.publicinterface.Session session)
          INTERNAL: Return whether the element's user-defined Map key has changed since it was cloned from the original version.
 void mergeChangesIntoObject(java.lang.Object target, oracle.toplink.internal.sessions.ChangeRecord changeRecord, java.lang.Object source, oracle.toplink.internal.sessions.MergeManager mergeManager)
          INTERNAL: Merge changes from the source to the target object.
 void mergeIntoObject(java.lang.Object target, boolean isTargetUnInitialized, java.lang.Object source, oracle.toplink.internal.sessions.MergeManager mergeManager)
          INTERNAL: Merge changes from the source to the target object.
 void setContainerPolicy(oracle.toplink.internal.queryframework.ContainerPolicy containerPolicy)
          ADVANCED: Set the mapping's containerPolicy.
 void setFieldName(java.lang.String fieldName)
          PUBLIC: Set the mapping's field name.
 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 concreteContainerClass)
          PUBLIC: Configure the mapping to use an instance of the specified container class to hold the target objects.
 void useMapClass(java.lang.Class concreteContainerClass, java.lang.String methodName)
          PUBLIC: Configure the mapping to use an instance of the specified container class to hold the target objects.
 java.lang.Object valueFromRow(DatabaseRow row, ObjectLevelReadQuery query)
          INTERNAL: Build and return an aggregate collection from the specified row.
 void writeFromObjectIntoRow(java.lang.Object object, DatabaseRow row, oracle.toplink.publicinterface.Session session)
          INTERNAL: Get the attribute value from the object and add the appropriate values to the specified database row.
 void writeFromObjectIntoRowForUpdate(WriteObjectQuery writeQuery, DatabaseRow row)
          INTERNAL: Get the attribute value from the object and add the changed values to the specified database row.
 void writeFromObjectIntoRowWithChangeRecord(oracle.toplink.internal.sessions.ChangeRecord changeRecord, DatabaseRow row, oracle.toplink.publicinterface.Session session)
          INTERNAL: Get the attribute value from the object and add the appropriate values to the specified database row.
 void writeInsertFieldsIntoRow(DatabaseRow databaseRow, oracle.toplink.publicinterface.Session session)
          INTERNAL: Write fields needed for insert into the template with null values.

 

Methods inherited from class oracle.toplink.mappings.AggregateMapping
buildBackupClone, buildClone, buildCopy, buildExpression, fixObjectReferences, getReferenceClass, getReferenceDescriptor, isAggregateMapping, iterate, postDelete, postInsert, postUpdate, preDelete, preInsert, preUpdate, remoteInitialization, setReferenceClass, verifyDelete

 

Methods inherited from class oracle.toplink.mappings.DatabaseMapping
buildBackupCloneForPartObject, buildCloneForPartObject, buildObjectJoinExpression, buildObjectJoinExpression, cascadeMerge, clone, createUnitOfWorkValueHolder, fixRealObjectReferences, getAttributeAccessor, getAttributeClassification, getAttributeName, getAttributeValueFromObject, getDescriptor, getFieldClassification, getFields, getGetMethodName, getObjectCorrespondingTo, getProperties, getProperty, getRealAttributeValueFromObject, getRelationshipPartner, getSetMethodName, getValueFromRemoteValueHolder, getWeight, hasConstraintDependency, hasDependency, hasInverseConstraintDependency, isAggregateCollectionMapping, isAggregateObjectMapping, isCollectionMapping, isDatabaseMapping, isDirectCollectionMapping, isDirectToFieldMapping, isForeignReferenceMapping, isManyToManyMapping, isNestedTableMapping, isObjectReferenceMapping, isObjectTypeMapping, isOneToManyMapping, isOneToOneMapping, isPrivateOwned, isReadOnly, isReferenceMapping, isSerializedObjectMapping, isStructureMapping, isTransformationMapping, isTypeConversionMapping, isVariableOneToOneMapping, isWriteOnly, iterateOnRealAttributeValue, performDataModificationEvent, postInitialize, preInitialize, readFromRowIntoObject, readOnly, readWrite, rehashFieldDependancies, replaceValueHoldersIn, setAttributeAccessor, setAttributeName, setAttributeValueInObject, setDescriptor, setGetMethodName, setIsReadOnly, setProperties, setProperty, setRealAttributeValueInObject, setSetMethodName, setWeight, toString, validateAfterInitialization, validateBeforeInitialization, valueFromObject, writeFromObjectIntoRowForShallowInsert, writeFromObjectIntoRowForShallowInsertWithChangeRecord, writeFromObjectIntoRowForWhereClause, writeUpdateFieldsIntoRow

 

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

SDKAggregateCollectionMapping

public SDKAggregateCollectionMapping()
Default constructor.
Method Detail

buildAddedElementFromChangeSet

public java.lang.Object buildAddedElementFromChangeSet(java.lang.Object changeSet,
                                                       oracle.toplink.internal.sessions.MergeManager mergeManager)
INTERNAL: Build and return a new element based on the change set.
Specified by:
buildAddedElementFromChangeSet in interface SDKCollectionMapping

buildChangeSet

public java.lang.Object buildChangeSet(java.lang.Object element,
                                       oracle.toplink.internal.sessions.ObjectChangeSet owner,
                                       oracle.toplink.publicinterface.Session session)
INTERNAL: Build and return a change set for the specified element.
Specified by:
buildChangeSet in interface SDKCollectionMapping

buildElementFromElement

public java.lang.Object buildElementFromElement(java.lang.Object element,
                                                oracle.toplink.internal.sessions.MergeManager mergeManager)
INTERNAL: Build and return a new element based on the specified element.
Specified by:
buildElementFromElement in interface SDKCollectionMapping

buildRemovedElementFromChangeSet

public java.lang.Object buildRemovedElementFromChangeSet(java.lang.Object changeSet,
                                                         oracle.toplink.internal.sessions.MergeManager mergeManager)
INTERNAL: Build and return a new element based on the change set.
Specified by:
buildRemovedElementFromChangeSet in interface SDKCollectionMapping

compareElements

public boolean compareElements(java.lang.Object element1,
                               java.lang.Object element2,
                               oracle.toplink.publicinterface.Session session)
INTERNAL: Compare the non-null elements and return true if they are alike.
Specified by:
compareElements in interface SDKCollectionMapping

compareElementsForChange

public boolean compareElementsForChange(java.lang.Object element1,
                                        java.lang.Object element2,
                                        oracle.toplink.publicinterface.Session session)
INTERNAL: Compare the non-null elements and return true if they are alike.
Specified by:
compareElementsForChange in interface SDKCollectionMapping

compareForChange

public oracle.toplink.internal.sessions.ChangeRecord compareForChange(java.lang.Object clone,
                                                                      java.lang.Object backup,
                                                                      oracle.toplink.internal.sessions.ObjectChangeSet owner,
                                                                      oracle.toplink.publicinterface.Session session)
INTERNAL: Build and return the change record that results from comparing the two aggregate collection attributes.
Overrides:
compareForChange in class AggregateMapping

compareObjects

public boolean compareObjects(java.lang.Object object1,
                              java.lang.Object object2,
                              oracle.toplink.publicinterface.Session session)
INTERNAL: Compare the attributes belonging to this mapping for the objects.
Overrides:
compareObjects in class AggregateMapping

getContainerPolicy

public oracle.toplink.internal.queryframework.ContainerPolicy getContainerPolicy()
INTERNAL: Return the mapping's containerPolicy.
Specified by:
getContainerPolicy in interface ContainerMapping
Overrides:
getContainerPolicy in class DatabaseMapping

getField

public oracle.toplink.internal.helper.DatabaseField getField()
INTERNAL: Return the field mapped by this mapping.
Overrides:
getField in class DatabaseMapping

getFieldName

public java.lang.String getFieldName()
PUBLIC: Return the mapping's field name. This is the field in the database row that will hold the nested rows that make up the aggregate collection.

getRealCollectionAttributeValueFromObject

public java.lang.Object getRealCollectionAttributeValueFromObject(java.lang.Object object,
                                                                  oracle.toplink.publicinterface.Session session)
                                                           throws DescriptorException
INTERNAL: Convenience method. Return the value of an attribute, unwrapping value holders if necessary. If the value is null, build a new container.
Specified by:
getRealCollectionAttributeValueFromObject in interface SDKCollectionMapping
Overrides:
getRealCollectionAttributeValueFromObject in class DatabaseMapping
Throws:
DescriptorException

initialize

public void initialize(oracle.toplink.publicinterface.Session session)
                throws DescriptorException
INTERNAL: The mapping is initialized with the given session. This mapping is fully initialized after this.
Overrides:
initialize in class AggregateMapping
Throws:
DescriptorException

mapKeyHasChanged

public boolean mapKeyHasChanged(java.lang.Object element,
                                oracle.toplink.publicinterface.Session session)
INTERNAL: Return whether the element's user-defined Map key has changed since it was cloned from the original version. Aggregate elements cannot change their keys without detection.
Specified by:
mapKeyHasChanged in interface SDKCollectionMapping

mergeChangesIntoObject

public void mergeChangesIntoObject(java.lang.Object target,
                                   oracle.toplink.internal.sessions.ChangeRecord changeRecord,
                                   java.lang.Object source,
                                   oracle.toplink.internal.sessions.MergeManager mergeManager)
INTERNAL: Merge changes from the source to the target object.
Overrides:
mergeChangesIntoObject in class AggregateMapping

mergeIntoObject

public void mergeIntoObject(java.lang.Object target,
                            boolean isTargetUnInitialized,
                            java.lang.Object source,
                            oracle.toplink.internal.sessions.MergeManager mergeManager)
INTERNAL: Merge changes from the source to the target object. Simply replace the entire target collection.
Overrides:
mergeIntoObject in class AggregateMapping

setContainerPolicy

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

setFieldName

public void setFieldName(java.lang.String fieldName)
PUBLIC: Set the mapping's field name. This is the field in the database row that will hold the nested rows that make up the aggregate 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 concreteContainerClass)
PUBLIC: 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

useMapClass

public void useMapClass(java.lang.Class concreteContainerClass,
                        java.lang.String methodName)
PUBLIC: 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

valueFromRow

public java.lang.Object valueFromRow(DatabaseRow row,
ObjectLevelReadQuery query)
                              throws DatabaseException
INTERNAL: Build and return an aggregate collection from the specified row.
Overrides:
valueFromRow in class DatabaseMapping
Throws:
DatabaseException

writeFromObjectIntoRow

public void writeFromObjectIntoRow(java.lang.Object object,
DatabaseRow row,
                                   oracle.toplink.publicinterface.Session session)
                            throws DescriptorException
INTERNAL: Get the attribute value from the object and add the appropriate values to the specified database row.
Overrides:
writeFromObjectIntoRow in class DatabaseMapping
Throws:
DescriptorException

writeFromObjectIntoRowForUpdate

public void writeFromObjectIntoRowForUpdate(WriteObjectQuery writeQuery,
DatabaseRow row)
                                     throws DescriptorException
INTERNAL: Get the attribute value from the object and add the changed values to the specified database row.
Overrides:
writeFromObjectIntoRowForUpdate in class DatabaseMapping
Throws:
DescriptorException

writeFromObjectIntoRowWithChangeRecord

public void writeFromObjectIntoRowWithChangeRecord(oracle.toplink.internal.sessions.ChangeRecord changeRecord,
DatabaseRow row,
                                                   oracle.toplink.publicinterface.Session session)
                                            throws DescriptorException
INTERNAL: Get the attribute value from the object and add the appropriate values to the specified database row.
Overrides:
writeFromObjectIntoRowWithChangeRecord in class DatabaseMapping
Throws:
DescriptorException

writeInsertFieldsIntoRow

public void writeInsertFieldsIntoRow(DatabaseRow databaseRow,
                                     oracle.toplink.publicinterface.Session session)
INTERNAL: Write fields needed for insert into the template with null values.
Overrides:
writeInsertFieldsIntoRow in class DatabaseMapping

Copyright © 1998, 2004 Oracle Corporation. All Rights Reserved.