Top Description Fields Constructors Methods
org.eclipse.persistence.mappings

public abstract Class AggregateMapping

extends DatabaseMapping
Class Inheritance
Known Direct Subclasses
org.eclipse.persistence.mappings.AggregateObjectMapping, org.eclipse.persistence.mappings.foundation.AbstractCompositeCollectionMapping, org.eclipse.persistence.mappings.foundation.AbstractCompositeObjectMapping, org.eclipse.persistence.oxm.mappings.XMLInverseReferenceMapping, org.eclipse.persistence.oxm.mappings.XMLObjectReferenceMapping
Imports
java.util.*, java.security.AccessController, .PrivilegedActionException, org.eclipse.persistence.internal.descriptors.changetracking.AggregateAttributeChangeListener, .AttributeChangeListener, org.eclipse.persistence.descriptors.ClassDescriptor, .DescriptorEventManager, .DescriptorQueryManager, org.eclipse.persistence.descriptors.changetracking.ChangeTracker, org.eclipse.persistence.exceptions.*, org.eclipse.persistence.expressions.*, org.eclipse.persistence.internal.descriptors.*, org.eclipse.persistence.internal.helper.IdentityHashSet, org.eclipse.persistence.internal.identitymaps.CacheKey, org.eclipse.persistence.internal.security.PrivilegedAccessHelper, .PrivilegedClassForName, org.eclipse.persistence.internal.sessions.*, org.eclipse.persistence.internal.sessions.remote.ObjectDescriptor, org.eclipse.persistence.queries.*, org.eclipse.persistence.sessions.remote.*, org.eclipse.persistence.sessions.CopyGroup, org.eclipse.persistence.internal.queries.AttributeItem, .JoinedAttributeManager

Purpose: Two objects can be considered to be related by aggregation if there is a strict 1:1 relationship between the objects. This means that if the source (parent)object exists, then the target (child or owned) object must exist. This class implements the behavior common to the aggregate object and structure mappings.
Author
Sati
Since
TopLink for Java 1.0

Field Summary

Modifier and TypeField and Description
protected Boolean
hasNestedIdentityReference

Indicates whether the mapping (or at least one of its nested mappings, at any nested depth) references an entity.

protected Class<?>
referenceClass

Stores a reference class

protected String
protected ClassDescriptor
referenceDescriptor

The descriptor of the reference class

Inherited from org.eclipse.persistence.mappings.DatabaseMapping:
attributeAccessorattributeNamederivedIdMappingderivesIddescriptorfieldsisCacheableisInSopObjectisJPAIdisLazyisMapKeyMappingisOptionalisPrimaryKeyMappingisReadOnlyisRemotelyInitializedmapsIdValueNO_FIELDSNO_WEIGHTpropertiesunconvertedPropertiesweightWEIGHT_AGGREGATEWEIGHT_DIRECTWEIGHT_TO_ONEWEIGHT_TRANSFORM

Constructor Summary

AccessConstructor and Description
protected
AggregateMapping()

Default constructor.

Method Summary

Modifier and TypeMethod and Description
protected DeleteObjectQuery
buildAggregateDeleteQuery(DeleteObjectQuery sourceQuery, Object sourceAttributeValue)

Make a copy of the sourceQuery for the attribute.

protected void
buildAggregateModifyQuery(ObjectLevelModifyQuery sourceQuery, ObjectLevelModifyQuery aggregateQuery, Object sourceAttributeValue)

Initialize the aggregate query with the settings from the source query.

protected WriteObjectQuery
buildAggregateWriteQuery(WriteObjectQuery sourceQuery, Object sourceAttributeValue)

Make a copy of the sourceQuery for the attribute.

public void
buildBackupClone(Object
TODO
clone
,
Object
TODO
backup
,
UnitOfWorkImpl
TODO
unitOfWork
)

Implements abstract org.eclipse.persistence.mappings.DatabaseMapping.buildBackupClone.

INTERNAL: Clone the attribute from the clone and assign it to the backup.
protected Object
buildBackupClonePart(Object attributeValue, UnitOfWorkImpl unitOfWork)

INTERNAL: Build and return a backup clone of the attribute.

public void
buildClone(Object
TODO
original
,
CacheKey
TODO
cacheKey
,
Object
TODO
clone
,
Integer
TODO
refreshCascade
,
AbstractSession
TODO
cloningSession
)

Implements abstract org.eclipse.persistence.mappings.DatabaseMapping.buildClone.

INTERNAL: Clone the attribute from the original and assign it to the clone.
public void
buildCloneFromRow(AbstractRecord
TODO
databaseRow
,
JoinedAttributeManager
TODO
joinManager
,
Object
TODO
clone
,
CacheKey
TODO
sharedCacheKey
,
ObjectBuildingQuery
TODO
sourceQuery
,
UnitOfWorkImpl
TODO
unitOfWork
,
AbstractSession
TODO
executionSession
)

Implements abstract org.eclipse.persistence.mappings.DatabaseMapping.buildCloneFromRow.

INTERNAL: A combination of readFromRowIntoObject and buildClone.
protected Object
buildClonePart(Object original, Object clone, CacheKey cacheKey, Object attributeValue, Integer refreshCascade, AbstractSession cloningSession)

INTERNAL: Build and return a clone of the attribute.

protected Object
buildClonePart(Object attributeValue, Object clone, CacheKey parentCacheKey, Integer refreshCascade, AbstractSession cloningSession, boolean isNewObject)

INTERNAL: * Build and return a clone of the attribute.

public void
buildCopy(Object
TODO
copy
,
Object
TODO
original
,
CopyGroup
TODO
group
)

Overrides org.eclipse.persistence.mappings.DatabaseMapping.buildCopy.

INTERNAL: Copy of the attribute of the object.
protected Object
buildCopyOfAttributeValue(Object attributeValue, CopyGroup group)

Copy of the attribute of the object.

public Expression
buildExpression(Object
TODO
queryObject
,
QueryByExamplePolicy
TODO
policy
,
Expression
TODO
expressionBuilder
,
Map<K, V>
TODO
processedObjects
,
AbstractSession
TODO
session
)

Overrides org.eclipse.persistence.mappings.DatabaseMapping.buildExpression.

INTERNAL: In case Query By Example is used, this method generates an expression from a attribute value pair.
protected Object
buildNewMergeInstanceOf(Object sourceAttributeValue, AbstractSession session)

INTERNAL: Build and return a new instance of the specified attribute.

protected boolean
compareAttributeValues(Object attributeValue1, Object attributeValue2, AbstractSession session)

INTERNAL: Compare the attributes.

public ChangeRecord
compareForChange(Object
TODO
clone
,
Object
TODO
backup
,
ObjectChangeSet
TODO
owner
,
AbstractSession
TODO
session
)

Implements abstract org.eclipse.persistence.mappings.DatabaseMapping.compareForChange.

INTERNAL: Compare the changes between two aggregates.
public boolean
compareObjects(Object
TODO
firstObject
,
Object
TODO
secondObject
,
AbstractSession
TODO
session
)

Implements abstract org.eclipse.persistence.mappings.DatabaseMapping.compareObjects.

INTERNAL: Compare the attributes belonging to this mapping for the objects.
public void
convertClassNamesToClasses(ClassLoader
TODO
classLoader
)

Overrides org.eclipse.persistence.mappings.DatabaseMapping.convertClassNamesToClasses.

INTERNAL: Convert all the class-name-based settings in this mapping to actual class-based settings.
protected void
executeEvent(int eventCode, ObjectLevelModifyQuery query)

INTERNAL: Execute a descriptor event for the specified event code.

protected void
fixAttributeValue(Object attributeValue, Map<Object, ObjectDescriptor> objectDescriptors, Map<Object, Object> processedObjects, ObjectLevelReadQuery query, DistributedSession session)

INTERNAL: An object has been serialized from the server to the remote client.

public void
fixObjectReferences(Object
TODO
object
,
Map<Object, ObjectDescriptor>
TODO
objectDescriptors
,
Map<Object, Object>
TODO
processedObjects
,
ObjectLevelReadQuery
TODO
query
,
DistributedSession
TODO
session
)

Implements abstract org.eclipse.persistence.mappings.DatabaseMapping.fixObjectReferences.

INTERNAL: An object has been serialized from the server to the remote client.
protected Object
getAttributeValueFromBackupClone(Object backupClone)

Return the appropriate attribute value.

protected ObjectBuilder
getObjectBuilder(Object attributeValue, AbstractSession session)

Convenience method

protected ObjectBuilder
getObjectBuilderForClass(Class<?> javaClass, AbstractSession session)

Convenience method

protected DescriptorQueryManager
getQueryManager(Object attributeValue, AbstractSession session)

Convenience method

public Class<?>
getReferenceClass()

PUBLIC: Returns the reference class

public String
getReferenceClassName()

INTERNAL: Used by MW.

public ClassDescriptor
protected ClassDescriptor
getReferenceDescriptor(Class<?> theClass, AbstractSession session)

INTERNAL: For inheritance purposes.

protected ClassDescriptor
getReferenceDescriptor(Object attributeValue, AbstractSession session)

Convenience method

public boolean
hasNestedIdentityReference()

Overrides org.eclipse.persistence.mappings.DatabaseMapping.hasNestedIdentityReference.

INTERNAL: Indicates whether the mapping (or at least one of its nested mappings, at any nested depth) references an entity.
public void
initialize(AbstractSession session)

Overrides org.eclipse.persistence.mappings.DatabaseMapping.initialize.

INTERNAL: Initialize the reference descriptor.
public boolean
isAggregateMapping()

Overrides org.eclipse.persistence.mappings.DatabaseMapping.isAggregateMapping.

INTERNAL: Related mapping should implement this method to return true.
public void
iterate(DescriptorIterator iterator)

Implements abstract org.eclipse.persistence.mappings.DatabaseMapping.iterate.

INTERNAL: Iterate on the appropriate attribute value.
protected void
iterateOnAttributeValue(DescriptorIterator iterator, Object attributeValue)

Iterate on the specified attribute value.

public void
load(final Object object, AttributeItem item, final AbstractSession session, final boolean fromFetchGroup)

Overrides org.eclipse.persistence.mappings.DatabaseMapping.load.

Force instantiation of the load group.
public void
loadAll(Object object, AbstractSession session, IdentityHashSet loaded)

Overrides org.eclipse.persistence.mappings.DatabaseMapping.loadAll.

Force instantiation of all indirections.
protected void
mergeAttributeValue(Object targetAttributeValue, boolean isTargetUnInitialized, Object sourceAttributeValue, MergeManager mergeManager, AbstractSession targetSession)

Merge the attribute values.

public void
mergeChangesIntoObject(Object target, ChangeRecord changeRecord, Object source, MergeManager mergeManager, AbstractSession targetSession)

Implements abstract org.eclipse.persistence.mappings.DatabaseMapping.mergeChangesIntoObject.

INTERNAL: Merge changes from the source to the target object.
public void
mergeIntoObject(Object target, boolean isTargetUnInitialized, Object source, MergeManager mergeManager, AbstractSession targetSession)

Implements abstract org.eclipse.persistence.mappings.DatabaseMapping.mergeIntoObject.

INTERNAL: Merge changes from the source to the target object.
public void
postDelete(DeleteObjectQuery query)

Overrides org.eclipse.persistence.mappings.DatabaseMapping.postDelete.

INTERNAL: The message is passed to its reference class descriptor.
public void
postDeleteAttributeValue(DeleteObjectQuery query, Object attributeValue)

INTERNAL: The message is passed to its reference class descriptor.

public void
postInsert(WriteObjectQuery query)

Overrides org.eclipse.persistence.mappings.DatabaseMapping.postInsert.

INTERNAL: The message is passed to its reference class descriptor.
public void
postInsertAttributeValue(WriteObjectQuery query, Object attributeValue)

INTERNAL: The message is passed to its reference class descriptor.

public void
postUpdate(WriteObjectQuery query)

Overrides org.eclipse.persistence.mappings.DatabaseMapping.postUpdate.

INTERNAL: The message is passed to its reference class descriptor.
public void
postUpdateAttributeValue(WriteObjectQuery query, Object attributeValue)

INTERNAL: The message is passed to its reference class descriptor.

public void
preDelete(DeleteObjectQuery query)

Overrides org.eclipse.persistence.mappings.DatabaseMapping.preDelete.

INTERNAL: The message is passed to its reference class descriptor.
public void
preDeleteAttributeValue(DeleteObjectQuery query, Object attributeValue)

INTERNAL: The message is passed to its reference class descriptor.

public void
preInsert(WriteObjectQuery query)

Overrides org.eclipse.persistence.mappings.DatabaseMapping.preInsert.

INTERNAL: The message is passed to its reference class descriptor.
public void
preInsertAttributeValue(WriteObjectQuery query, Object attributeValue)

INTERNAL: The message is passed to its reference class descriptor.

public void
preUpdate(WriteObjectQuery query)

Overrides org.eclipse.persistence.mappings.DatabaseMapping.preUpdate.

INTERNAL: The message is passed to its reference class descriptor.
public void
preUpdateAttributeValue(WriteObjectQuery query, Object attributeValue)

INTERNAL: The message is passed to its reference class descriptor.

public void
remoteInitialization(DistributedSession session)

Overrides org.eclipse.persistence.mappings.DatabaseMapping.remoteInitialization.

INTERNAL: Once a descriptor is serialized to the remote session, all its mappings and reference descriptors are traversed.
public void
setReferenceClass(Class<?> aClass)

PUBLIC: This is a reference class whose instances this mapping will store in the domain objects.

public void
setReferenceClassName(String aClassName)

INTERNAL: Used by MW.

protected void
setReferenceDescriptor(ClassDescriptor aDescriptor)

INTERNAL: Set the referenceDescriptor.

public void
updateChangeRecord(Object sourceClone, Object newValue, Object oldValue, ObjectChangeSet objectChangeSet, UnitOfWorkImpl uow)

Overrides org.eclipse.persistence.mappings.DatabaseMapping.updateChangeRecord.

INTERNAL: Either create a new change record or update the change record with the new value.
public boolean
verifyDelete(Object object, AbstractSession session)

Overrides org.eclipse.persistence.mappings.DatabaseMapping.verifyDelete.

INTERNAL: Return whether the specified object and all its components have been deleted.
protected boolean
verifyDeleteOfAttributeValue(Object attributeValue, AbstractSession session)

INTERNAL: Return whether the specified object and all its components have been deleted.

Inherited from org.eclipse.persistence.mappings.DatabaseMapping:
addUnconvertedPropertybuildBackupCloneForPartObjectbuildChangeRecordbuildCloneForPartObjectbuildContainerClonebuildObjectJoinExpressionbuildObjectJoinExpressionbuildShallowOriginalFromRowcalculateDeferredChangescascadeDiscoverAndPersistUnregisteredNewObjectscascadePerformRemoveIfRequiredcascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequiredcascadeRegisterNewIfRequiredclonecloneFieldscollectFieldscollectQueryParametersconvertConverterClassNamesToClassescreateCloneValueHolderderivesIdearlyPreDeleteextractNestedExpressionsextractNestedNonAggregateExpressionsfixRealObjectReferencesgetAttributeAccessorgetAttributeClassificationgetAttributeNamegetAttributeValueFromObjectgetContainerPolicygetDerivedIdMappinggetDescriptorgetFieldgetFieldClassificationgetFieldsgetGetMethodNamegetMapsIdValuegetObjectCorrespondingTogetOrderByNormalizedExpressionsgetPropertiesgetPropertygetRealAttributeValueFromAttributegetRealAttributeValueFromObjectgetRealCollectionAttributeValueFromObjectgetRelationshipPartnergetSelectFieldsgetSelectTablesgetSetMethodNamegetUnconvertedPropertiesgetValueFromRemoteValueHoldergetWeighthasConstraintDependencyhasDependencyhasInverseConstraintDependencyhasMapsIdValuehasRootExpressionThatShouldUseOuterJoinhasUnconvertedPropertiesinstantiateAttributeisAbstractColumnMappingisAbstractCompositeCollectionMappingisAbstractCompositeDirectCollectionMappingisAbstractCompositeObjectMappingisAbstractDirectMappingisAggregateCollectionMappingisAggregateObjectMappingisAttributeValueFromObjectInstantiatedisCacheableisCandidateForPrivateOwnedRemovalisCascadedLockingSupportedisChangeTrackingSupportedisCloningRequiredisCollectionMappingisDatabaseMappingisDirectCollectionMappingisDirectMapMappingisDirectToFieldMappingisDirectToXMLTypeMappingisEISMappingisElementCollectionMappingisForeignReferenceMappingisInAndOutSopObjectisInOnlySopObjectisInSopObjectisJoiningSupportedisJPAIdisLazyisLockableMappingisManyToManyMappingisManyToOneMappingisMapKeyMappingisMultitenantPrimaryKeyMappingisNestedTableMappingisObjectReferenceMappingisOneToManyMappingisOneToOneMappingisOptionalisOutOnlySopObjectisOutSopObjectisOwnedisPrimaryKeyMappingisPrivateOwnedisReadOnlyisReferenceMappingisRelationalMappingisRemotelyInitializedisStructureMappingisTransformationMappingisUnidirectionalOneToManyMappingisUsingMethodAccessisVariableOneToOneMappingisWriteOnlyisXMLMappingiterateOnRealAttributeValueperformDataModificationEventpostCalculateChangespostCalculateChangesOnDeletedpostInitializepostInitializeSourceAndTargetExpressionspreInitializeprepareCascadeLockingPolicyreadFromResultSetIntoObjectreadFromRowIntoObjectreadOnlyreadWriterecordPrivateOwnedRemovalsrehashFieldDependanciesremotelyInitializedreplaceValueHoldersInsetAttributeAccessorsetAttributeNamesetAttributeValueInObjectsetChangeListenersetDerivedIdMappingsetDerivesIdsetDescriptorsetFieldssetGetMethodNamesetIsCacheablesetIsInAndOutSopObjectsetIsInSopObjectsetIsJPAIdsetIsLazysetIsMapKeyMappingsetIsOptionalsetIsOutSopObjectsetIsPrimaryKeyMappingsetIsReadOnlysetMapsIdValuesetPropertiessetPropertysetRealAttributeValueInObjectsetSetMethodNamesetWeightsimpleAddToCollectionChangeRecordsimpleRemoveFromCollectionChangeRecordtoStringupdateCollectionChangeRecordvalidateAfterInitializationvalidateBeforeInitializationvalueFromObjectvalueFromResultSetvalueFromRowvalueFromRowwriteFromAttributeIntoRowwriteFromObjectIntoRowwriteFromObjectIntoRowForShallowInsertwriteFromObjectIntoRowForShallowInsertWithChangeRecordwriteFromObjectIntoRowForUpdatewriteFromObjectIntoRowForUpdateAfterShallowInsertwriteFromObjectIntoRowForUpdateBeforeShallowDeletewriteFromObjectIntoRowForWhereClausewriteFromObjectIntoRowWithChangeRecordwriteInsertFieldsIntoRowwriteUpdateFieldsIntoRow