Oracle Application Server TopLink API Reference
10g Release 2 (10.1.2)

B15903-01


oracle.toplink.mappings
Class AggregateCollectionMapping

java.lang.Object
  extended byoracle.toplink.mappings.DatabaseMapping
      extended byoracle.toplink.mappings.ForeignReferenceMapping
          extended byoracle.toplink.mappings.CollectionMapping
              extended byoracle.toplink.mappings.AggregateCollectionMapping

All Implemented Interfaces:
java.lang.Cloneable, ContainerMapping, java.io.Serializable

public class AggregateCollectionMapping
extends CollectionMapping

Purpose: The aggregate collection mapping is used to represent the aggregate relationship between a single source object and a collection of target objects. The target objects cannot exist without the existence of the source object (privately owned) Unlike the normal aggregate mapping, there is a target table being mapped from the target objects. Unlike normal 1:m mapping, there is no 1:1 back reference mapping, as foreign key constraints have been resolved by the aggregation.

Since:
TOPLink/Java 3.0
See Also:
Serialized Form

Constructor Summary
AggregateCollectionMapping()
PUBLIC: Default constructor.

Method Summary
void addTargetForeignKeyFieldName(java.lang.String targetForeignKey, java.lang.String sourceKey)
PUBLIC: Define the target foreign key relationship in the 1-M aggregate collection mapping.
java.util.Vector getSourceKeyFieldNames()
PUBLIC: Return the source key field names associated with the mapping.
java.util.Vector getTargetForeignKeyFieldNames()
PUBLIC: Return the target foregin key field names associated with the mapping.
void setSourceKeyFieldNames(java.util.Vector fieldNames)
PUBLIC: Set the source key field names associated with the mapping.
void setTargetForeignKeyFieldNames(java.util.Vector fieldNames)
PUBLIC: Set the target foregin key field names associated with the mapping.
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.

Methods inherited from class oracle.toplink.mappings.CollectionMapping
addAscendingOrdering, addDescendingOrdering, getRealCollectionAttributeValueFromObject, setContainerPolicy, setCustomDeleteAllQuery, setDeleteAllSQLString, setSessionName, useCollectionClass, useMapClass, useSortedSetClass, useTransparentCollection, useTransparentMap

Methods inherited from class oracle.toplink.mappings.ForeignReferenceMapping
dontUseBatchReading, dontUseIndirection, getReferenceClass, getRelationshipPartnerAttributeName, privateOwnedRelationship, setCustomSelectionQuery, setIndirectionPolicy, setReferenceClass, setRelationshipPartnerAttributeName, setSelectionCriteria, setSelectionSQLString, setUsesBatchReading, setUsesIndirection, shouldUseBatchReading, useBasicIndirection, useBatchReading, useContainerIndirection, useIndirection, usesIndirection

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

Constructor Detail

AggregateCollectionMapping

public AggregateCollectionMapping()
PUBLIC: Default constructor.

Method Detail

addTargetForeignKeyFieldName

public void addTargetForeignKeyFieldName(java.lang.String targetForeignKey,
                                         java.lang.String sourceKey)
PUBLIC: Define the target foreign key relationship in the 1-M aggregate collection mapping. Both the target foreign key field name and the source primary key field name must be specified.

getSourceKeyFieldNames

public java.util.Vector getSourceKeyFieldNames()
PUBLIC: Return the source key field names associated with the mapping. These are in-order with the targetForeignKeyFieldNames.

getTargetForeignKeyFieldNames

public java.util.Vector getTargetForeignKeyFieldNames()
PUBLIC: Return the target foregin key field names associated with the mapping. These are in-order with the sourceKeyFieldNames.

setSourceKeyFieldNames

public void setSourceKeyFieldNames(java.util.Vector fieldNames)
PUBLIC: Set the source key field names associated with the mapping. These must be in-order with the targetForeignKeyFieldNames.

setTargetForeignKeyFieldNames

public void setTargetForeignKeyFieldNames(java.util.Vector fieldNames)
PUBLIC: Set the target foregin key field names associated with the mapping. These must be in-order with the sourceKeyFieldNames.

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. PLEASE ENSURE that the changes have been made in the object model first.
Overrides:
simpleAddToCollectionChangeRecord in class CollectionMapping

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. PLEASE ENSURE that the changes have been made in the object model first.
Overrides:
simpleRemoveFromCollectionChangeRecord in class CollectionMapping

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