Package org.eclipse.persistence.mappings
Class AggregateCollectionMapping
- java.lang.Object
-
- org.eclipse.persistence.core.mappings.CoreMapping<AttributeAccessor,org.eclipse.persistence.internal.sessions.AbstractSession,org.eclipse.persistence.internal.queries.ContainerPolicy,ClassDescriptor,org.eclipse.persistence.internal.helper.DatabaseField>
-
- org.eclipse.persistence.mappings.DatabaseMapping
-
- org.eclipse.persistence.mappings.ForeignReferenceMapping
-
- org.eclipse.persistence.mappings.CollectionMapping
-
- org.eclipse.persistence.mappings.AggregateCollectionMapping
-
- All Implemented Interfaces:
Serializable,Cloneable,ContainerMapping,EmbeddableMapping,MapComponentMapping,RelationalMapping
public class AggregateCollectionMapping extends CollectionMapping implements RelationalMapping, MapComponentMapping, EmbeddableMapping
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
- Author:
- King (Yaoping) Wang
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.persistence.mappings.DatabaseMapping
DatabaseMapping.WriteType
-
-
Field Summary
-
Fields inherited from class org.eclipse.persistence.mappings.ForeignReferenceMapping
INNER_JOIN, NONE, OUTER_JOIN, QUERY_BATCH_PARAMETER
-
-
Constructor Summary
Constructors Constructor Description AggregateCollectionMapping()PUBLIC: Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddConverter(Converter converter, String attributeName)Add a converter to be applied to a mapping of the aggregate descriptor.voidaddFieldNameTranslation(String sourceFieldName, String aggregateFieldName)PUBLIC: Maps a field name in the aggregate descriptor to a field name in the source table.voidaddFieldTranslation(org.eclipse.persistence.internal.helper.DatabaseField sourceField, String aggregateField)PUBLIC: Maps a field name in the aggregate descriptor to a field in the source table.voidaddFieldTranslations(Map<String,org.eclipse.persistence.internal.helper.DatabaseField> map)PUBLIC: Maps a field name in the aggregate descriptor to a field name in the source table.voidaddNestedFieldNameTranslation(String attributeName, String sourceFieldName, String aggregateFieldName)PUBLIC: Map the name of an attribute of the reference descriptor mapped with AggregateCollectionMapping to aggregateToSourceFieldNames that should be applied to this mapping.voidaddNestedFieldNameTranslations(String attributeName, Map<String,org.eclipse.persistence.internal.helper.DatabaseField> map)PUBLIC: Map the name of an attribute of the reference descriptor mapped with AggregateCollectionMapping to aggregateToSourceFields that should be applied to this mapping.voidaddNestedFieldTranslation(String attributeName, org.eclipse.persistence.internal.helper.DatabaseField sourceField, String aggregateFieldName)PUBLIC: Map the name of an attribute of the reference descriptor mapped with AggregateCollectionMapping to aggregateToSourceFieldNames that should be applied to this mapping.voidaddOverrideManyToManyMapping(ManyToManyMapping mapping)INTERNAL: In JPA users may specify overrides to apply to a many to many mapping on a shared embeddable descriptor.voidaddOverrideUnidirectionalOneToManyMapping(UnidirectionalOneToManyMapping mapping)INTERNAL: In JPA users may specify overrides to apply to a unidirectional one to many mapping on a shared embeddable descriptor.voidaddTargetForeignKeyField(org.eclipse.persistence.internal.helper.DatabaseField targetForeignKey, org.eclipse.persistence.internal.helper.DatabaseField sourceKey)PUBLIC: Define the target foreign key relationship in the 1-M aggregate collection mapping.voidaddTargetForeignKeyFieldName(String targetForeignKey, String sourceKey)PUBLIC: Define the target foreign key relationship in the 1-M aggregate collection mapping.ObjectbuildBackupCloneForPartObject(Object attributeValue, Object clone, Object backup, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork)INTERNAL: Used during building the backup shallow copy to copy the vector without re-registering the target objects.ObjectbuildCloneForPartObject(Object attributeValue, Object original, org.eclipse.persistence.internal.identitymaps.CacheKey cacheKey, Object clone, org.eclipse.persistence.internal.sessions.AbstractSession cloningSession, Integer refreshCascade, boolean isExisting, boolean isFromSharedCache)INTERNAL: Require for cloning, the part must be cloned.ObjectbuildElementClone(Object element, Object parent, org.eclipse.persistence.internal.identitymaps.CacheKey parentCacheKey, Integer refreshCascade, org.eclipse.persistence.internal.sessions.AbstractSession cloningSession, boolean isExisting, boolean isFromSharedCache)INTERNAL: Clone the aggregate collection, if necessary.ExpressionbuildExpression(Object queryObject, QueryByExamplePolicy policy, Expression expressionBuilder, Map processedObjects, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: In case Query By Example is used, this method builds and returns an expression that corresponds to a single attribute and it's value.voidcascadeDiscoverAndPersistUnregisteredNewObjects(Object object, Map newObjects, Map unregisteredExistingObjects, Map visitedObjects, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, Set cascadeErrors)INTERNAL: Cascade discover and persist new objects during commit.voidcascadePerformRemoveIfRequired(Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, Map visitedObjects)INTERNAL: Cascade registerNew for Create through mappings that require the cascadevoidcascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired(Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, Map visitedObjects)INTERNAL: Cascade perform removal of orphaned private owned objects from the UnitOfWorkChangeSetvoidcascadeRegisterNewIfRequired(Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, Map visitedObjects)INTERNAL: Cascade registerNew for Create through mappings that require the cascadeObjectclone()INTERNAL: The mapping clones itself to create deep copy.voidcollectQueryParameters(Set<org.eclipse.persistence.internal.helper.DatabaseField> cacheFields)INTERNAL: This method is used to store the FK fields that can be cached that correspond to noncacheable mappings the FK field values will be used to re-issue the query when cloning the shared cache entityorg.eclipse.persistence.internal.sessions.ChangeRecordcompareForChange(Object clone, Object backUp, org.eclipse.persistence.internal.sessions.ObjectChangeSet owner, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: This method is used to create a change record from comparing two aggregate collectionsbooleancompareLists(List firstList, List secondList, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Compare the attributes belonging to this mapping for the objects.booleancompareObjects(Object firstObject, Object secondObject, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Compare the attributes belonging to this mapping for the objects.voidconvertClassNamesToClasses(ClassLoader classLoader)INTERNAL: Convert all the class-name-based settings in this mapping to actual class-based settings.ObjectcreateMapComponentFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord dbRow, ObjectBuildingQuery query, org.eclipse.persistence.internal.identitymaps.CacheKey parentCacheKey, org.eclipse.persistence.internal.sessions.AbstractSession session, boolean isTargetProtected)INTERNAL Called when a DatabaseMapping is used to map the key in a collection.org.eclipse.persistence.internal.sessions.AbstractRecordgetAggregateRow(ObjectLevelModifyQuery query, Object object)INTERNAL: return the aggregate Record with the primary keys from the source table and target tableInsertObjectQuerygetAndPrepareModifyQueryForInsert(ObjectLevelModifyQuery originalQuery, Object object)INTERNAL: setup the modifyQuery for post insert/update and pre deleteClassDescriptorgetReferenceDescriptor()INTERNAL: Return the referenceDescriptor.ClassDescriptorgetReferenceDescriptor(Class theClass, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: for inheritance purposeVectorgetReferenceObjectKeys(ObjectLevelModifyQuery query)INTERNAL: get reference object keysVectorgetSourceKeyFieldNames()PUBLIC: Return the source key field names associated with the mapping.Vector<org.eclipse.persistence.internal.helper.DatabaseField>getSourceKeyFields()INTERNAL: Return the source key names associated with the mappingVectorgetTargetForeignKeyFieldNames()PUBLIC: Return the target foregin key field names associated with the mapping.Vector<org.eclipse.persistence.internal.helper.DatabaseField>getTargetForeignKeyFields()INTERNAL: Return the target foregin key fields associated with the mappingMap<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField>getTargetForeignKeyToSourceKeys()INTERNAL:booleanhasNestedIdentityReference()INTERNAL: Indicates whether the mapping (or at least one of its nested mappings, at any nested depth) references an entity.voidinitialize(org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: For aggregate collection mapping the reference descriptor is cloned.voidinitializeChildInheritance(ClassDescriptor parentDescriptor, org.eclipse.persistence.internal.sessions.AbstractSession session, HashMap<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> fieldTranslation, HashMap<org.eclipse.persistence.internal.helper.DatabaseTable,org.eclipse.persistence.internal.helper.DatabaseTable> tableTranslation)INTERNAL: For aggregate mapping the reference descriptor is cloned.voidinitializeParentInheritance(ClassDescriptor parentDescriptor, ClassDescriptor childDescriptor, org.eclipse.persistence.internal.sessions.AbstractSession session, HashMap<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> fieldTranslation, HashMap<org.eclipse.persistence.internal.helper.DatabaseTable,org.eclipse.persistence.internal.helper.DatabaseTable> tableTranslation)INTERNAL: For aggregate mapping the reference descriptor is cloned.booleanisAggregateCollectionMapping()INTERNAL:booleanisCandidateForPrivateOwnedRemoval()INTERNAL: AggregateCollection contents should not be considered for addition to the UnitOfWork private owned objects list for removal.booleanisCascadedLockingSupported()INTERNAL Return true if this mapping supports cascaded version optimistic locking.booleanisChangeTrackingSupported(Project project)INTERNAL: Return if this mapping supports change tracking.booleanisElementCollectionMapping()INTERNAL:booleanisJoiningSupported()INTERNAL: Return if this mapping support joining.booleanisListOrderFieldUpdatable()PUBLIC: indicates whether listOrderField value could be updated in the db.booleanisOwned()INTERNAL:booleanisRelationalMapping()INTERNAL:voiditerateOnElement(org.eclipse.persistence.internal.descriptors.DescriptorIterator iterator, Object element)INTERNAL: Iterate on the specified element.voidload(Object object, org.eclipse.persistence.internal.queries.AttributeItem item, org.eclipse.persistence.internal.sessions.AbstractSession session, boolean fromFetchGroup)Force instantiation of the load group.voidloadAll(Object object, org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.helper.IdentityHashSet loaded)Force instantiation of all indirections.voidmergeChangesIntoObject(Object target, org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord, Object source, org.eclipse.persistence.internal.sessions.MergeManager mergeManager, org.eclipse.persistence.internal.sessions.AbstractSession targetSession)INTERNAL: Merge changes from the source to the target object.voidmergeIntoObject(Object target, boolean isTargetUnInitialized, Object source, org.eclipse.persistence.internal.sessions.MergeManager mergeManager, org.eclipse.persistence.internal.sessions.AbstractSession targetSession)INTERNAL: Merge changes from the source to the target object.voidpostInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: For aggregate collection mapping the reference descriptor is cloned.voidpostInsert(WriteObjectQuery query)INTERNAL: Insert privately owned partsvoidpostUpdate(WriteObjectQuery writeQuery)INTERNAL: Update the privately owned partsvoidpreDelete(DeleteObjectQuery query)INTERNAL: Delete privately owned partsvoidpreInsert(WriteObjectQuery query)INTERNAL: The message is passed to its reference class descriptor.voidprepareModifyQueryForDelete(ObjectLevelModifyQuery originalQuery, ObjectLevelModifyQuery modifyQuery, Object wrappedObject, Map extraData)INTERNAL: setup the modifyQuery for pre deletevoidprepareModifyQueryForUpdate(ObjectLevelModifyQuery originalQuery, ObjectLevelModifyQuery modifyQuery, Object object)INTERNAL: setup the modifyQuery for update,ObjectLevelReadQueryprepareNestedJoins(org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, ObjectBuildingQuery baseQuery, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Clone and prepare the JoinedAttributeManager nested JoinedAttributeManager.voidremoteInitialization(DistributedSession session)INTERNAL: Once a descriptor is serialized to the remote session, all its mappings and reference descriptors are traversed.voidsetDefaultSourceTable(org.eclipse.persistence.internal.helper.DatabaseTable table)PUBLIC: Set a default source table to use with the source fields of this mapping.voidsetIsListOrderFieldUpdatable(boolean isUpdatable)PUBLIC: indicates whether listOrderField value could be updated in the db.voidsetSourceKeyFieldNames(Vector fieldNames)PUBLIC: Set the source key field names associated with the mapping.voidsetSourceKeyFields(Vector<org.eclipse.persistence.internal.helper.DatabaseField> sourceKeyFields)INTERNAL: set all the primary key names associated with this mappingvoidsetTargetForeignKeyFieldNames(Vector fieldNames)PUBLIC: Set the target foregin key field names associated with the mapping.voidsetTargetForeignKeyFields(Vector<org.eclipse.persistence.internal.helper.DatabaseField> targetForeignKeyFields)INTERNAL: set the target foregin key fields associated with the mappingvoidsimpleAddToCollectionChangeRecord(Object referenceKey, Object changeSetToAdd, org.eclipse.persistence.internal.sessions.ObjectChangeSet changeSet, org.eclipse.persistence.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.voidsimpleRemoveFromCollectionChangeRecord(Object referenceKey, Object changeSetToRemove, org.eclipse.persistence.internal.sessions.ObjectChangeSet changeSet, org.eclipse.persistence.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.booleanverifyDelete(Object object, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Checks if object is deleted from the database or not.-
Methods inherited from class org.eclipse.persistence.mappings.CollectionMapping
addAggregateOrderBy, addAscendingOrdering, addDescendingOrdering, addOrderBy, buildChangeRecord, buildContainerClone, buildCopy, buildElementUnitOfWorkClone, buildReferencesPKList, calculateDeferredChanges, compareCollectionsForChange, extractResultFromBatchQuery, fixRealObjectReferences, getContainerPolicy, getJoinCriteria, getListOrderField, getObjectCorrespondingTo, getOrderByQueryKeyExpressions, getOrderCorrectionType, getRealCollectionAttributeValueFromObject, getTargetPrimaryKeyFields, hasOrderBy, isAttributeValueInstantiatedOrChanged, isCollectionMapping, isListOrderFieldSupported, isMapKeyObjectRelationship, iterateOnRealAttributeValue, mustDeleteReferenceObjectsOneByOne, postCalculateChanges, postDelete, preUpdate, recordPrivateOwnedRemovals, replaceValueHoldersIn, setChangeListener, setContainerPolicy, setCustomDeleteAllQuery, setDeleteAllCall, setDeleteAllSQLString, setListOrderField, setListOrderFieldName, setMustDeleteReferenceObjectsOneByOne, setOrderCorrectionType, setSessionName, setUseLazyInstantiationForIndirectCollection, shouldUseLazyInstantiationForIndirectCollection, shouldUseListOrderFieldTableExpression, updateChangeRecord, updateChangeRecordForSelfMerge, updateCollectionChangeRecord, useCollectionClass, useCollectionClassName, useListClassName, useMapClass, useMapClass, useMapClassName, useSortedSetClass, useSortedSetClassName, useSortedSetClassName, useTransparentCollection, useTransparentList, useTransparentMap, useTransparentSet, validateBeforeInitialization, valueFromPKList, writeChanges
-
Methods inherited from class org.eclipse.persistence.mappings.ForeignReferenceMapping
addForeignKeyField, buildBackupClone, buildClone, buildCloneFromRow, createCloneValueHolder, dontUseBatchReading, dontUseIndirection, extendPessimisticLockScopeInSourceQuery, fixObjectReferences, getAttributeValueFromObject, getAttributeValueWithClonedValueHolders, getBatchFetchType, getFieldsForTranslationInAggregate, getIndirectionPolicy, getJoinFetch, getMappedBy, getOrderByNormalizedExpressions, getPartitioningPolicy, getPartitioningPolicyName, getRealAttributeValueFromAttribute, getReferenceClass, getReferenceClassName, getRelationshipPartner, getRelationshipPartnerAttributeName, getSelectionCriteria, getSelectionQuery, getValueFromRemoteValueHolder, hasCustomSelectionQuery, hasDependency, instantiateAttribute, isAttributeValueFromObjectInstantiated, isAttributeValueFullyBuilt, isAttributeValueInstantiated, isCascadeDetach, isCascadeMerge, isCascadeOnDeleteSetOnDatabase, isCascadePersist, isCascadeRefresh, isCascadeRemove, isForeignReferenceMapping, isInnerJoinFetched, isJoinFetched, isLazy, isLockableMapping, isOuterJoinFetched, isPrivateOwned, iterate, mergeRemoteValueHolder, preInitialize, prepareNestedBatchQuery, privateOwnedRelationship, readFromRowIntoObject, requiresTransientWeavedFields, setBatchFetchType, setCascadeAll, setCascadeDetach, setCascadeMerge, setCascadePersist, setCascadeRefresh, setCascadeRemove, setCustomSelectionQuery, setForceInitializationOfSelectionCriteria, setIndirectionPolicy, setIsCacheable, setIsCascadeOnDeleteSetOnDatabase, setIsPrivateOwned, setJoinFetch, setMappedBy, setPartitioningPolicy, setPartitioningPolicyName, setRealAttributeValueInObject, setReferenceClass, setReferenceClassName, setRelationshipPartner, setRelationshipPartnerAttributeName, setRequiresTransientWeavedFields, setSelectionCall, setSelectionCriteria, setSelectionSQLString, setShouldExtendPessimisticLockScope, setUsesBatchReading, setUsesIndirection, shouldExtendPessimisticLockScope, shouldExtendPessimisticLockScopeInDedicatedQuery, shouldExtendPessimisticLockScopeInSourceQuery, shouldExtendPessimisticLockScopeInTargetQuery, shouldMergeCascadeParts, shouldRefreshCascadeParts, shouldUseBatchReading, trimRowForJoin, trimRowForJoin, useBasicIndirection, useBatchReading, useContainerIndirection, useInnerJoinFetch, useOuterJoinFetch, usesIndirection, useWeavedIndirection, valueFromRow
-
Methods inherited from class org.eclipse.persistence.mappings.DatabaseMapping
addUnconvertedProperty, buildObjectJoinExpression, buildObjectJoinExpression, buildShallowOriginalFromRow, derivesId, earlyPreDelete, getAttributeAccessor, getAttributeClassification, getAttributeName, getDerivedIdMapping, getDescriptor, getField, getFieldClassification, getFields, getGetMethodName, getMapsIdValue, getProperties, getProperty, getRealAttributeValueFromObject, getSelectFields, getSelectTables, getSetMethodName, getUnconvertedProperties, getWeight, hasConstraintDependency, hasInverseConstraintDependency, hasMapsIdValue, hasUnconvertedProperties, isAbstractColumnMapping, isAbstractCompositeCollectionMapping, isAbstractCompositeDirectCollectionMapping, isAbstractCompositeObjectMapping, isAbstractDirectMapping, isAggregateMapping, isAggregateObjectMapping, isCacheable, isCloningRequired, isDatabaseMapping, isDirectCollectionMapping, isDirectMapMapping, isDirectToFieldMapping, isDirectToXMLTypeMapping, isEISMapping, isInAndOutSopObject, isInOnlySopObject, isInSopObject, isJPAId, isManyToManyMapping, isManyToOneMapping, isMapKeyMapping, isMultitenantPrimaryKeyMapping, isNestedTableMapping, isObjectReferenceMapping, isOneToManyMapping, isOneToOneMapping, isOptional, isOutOnlySopObject, isOutSopObject, isPrimaryKeyMapping, isReadOnly, isReferenceMapping, isStructureMapping, isTransformationMapping, isUnidirectionalOneToManyMapping, isUsingMethodAccess, isVariableOneToOneMapping, isWriteOnly, isXMLMapping, performDataModificationEvent, postCalculateChangesOnDeleted, postInitializeSourceAndTargetExpressions, prepareCascadeLockingPolicy, readFromResultSetIntoObject, readOnly, readWrite, rehashFieldDependancies, setAttributeAccessor, setAttributeName, setAttributeValueInObject, setDerivedIdMapping, setDerivesId, setDescriptor, setGetMethodName, setIsInAndOutSopObject, setIsInSopObject, setIsJPAId, setIsLazy, setIsMapKeyMapping, setIsOptional, setIsOutSopObject, setIsPrimaryKeyMapping, setIsReadOnly, setMapsIdValue, setProperties, setProperty, setSetMethodName, setWeight, toString, validateAfterInitialization, valueFromObject, valueFromResultSet, valueFromRow, writeFromAttributeIntoRow, writeFromObjectIntoRow, writeFromObjectIntoRowForShallowInsert, writeFromObjectIntoRowForShallowInsertWithChangeRecord, writeFromObjectIntoRowForUpdate, writeFromObjectIntoRowForUpdateAfterShallowInsert, writeFromObjectIntoRowForUpdateBeforeShallowDelete, writeFromObjectIntoRowForWhereClause, writeFromObjectIntoRowWithChangeRecord, writeInsertFieldsIntoRow, writeUpdateFieldsIntoRow
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.persistence.mappings.EmbeddableMapping
getAttributeName
-
-
-
-
Method Detail
-
isRelationalMapping
public boolean isRelationalMapping()
INTERNAL:- Overrides:
isRelationalMappingin classDatabaseMapping
-
addOverrideManyToManyMapping
public void addOverrideManyToManyMapping(ManyToManyMapping mapping)
INTERNAL: In JPA users may specify overrides to apply to a many to many mapping on a shared embeddable descriptor. These settings are applied at initialize time, after the reference descriptor is cloned. In an aggregate collection case, this is not supported and currently silently ignored and does nothing.- Specified by:
addOverrideManyToManyMappingin interfaceEmbeddableMapping
-
addOverrideUnidirectionalOneToManyMapping
public void addOverrideUnidirectionalOneToManyMapping(UnidirectionalOneToManyMapping mapping)
INTERNAL: In JPA users may specify overrides to apply to a unidirectional one to many mapping on a shared embeddable descriptor. These settings are applied at initialize time, after the reference descriptor is cloned. In an aggregate collection case, this is not supported and currently silently ignored and does nothing.- Specified by:
addOverrideUnidirectionalOneToManyMappingin interfaceEmbeddableMapping
-
addConverter
public void addConverter(Converter converter, String attributeName)
Add a converter to be applied to a mapping of the aggregate descriptor.- Specified by:
addConverterin interfaceEmbeddableMapping
-
addFieldNameTranslation
public void addFieldNameTranslation(String sourceFieldName, String aggregateFieldName)
PUBLIC: Maps a field name in the aggregate descriptor to a field name in the source table.
-
addFieldTranslation
public void addFieldTranslation(org.eclipse.persistence.internal.helper.DatabaseField sourceField, String aggregateField)PUBLIC: Maps a field name in the aggregate descriptor to a field in the source table.- Specified by:
addFieldTranslationin interfaceEmbeddableMapping
-
addFieldTranslations
public void addFieldTranslations(Map<String,org.eclipse.persistence.internal.helper.DatabaseField> map)
PUBLIC: Maps a field name in the aggregate descriptor to a field name in the source table.
-
addNestedFieldNameTranslation
public void addNestedFieldNameTranslation(String attributeName, String sourceFieldName, String aggregateFieldName)
PUBLIC: Map the name of an attribute of the reference descriptor mapped with AggregateCollectionMapping to aggregateToSourceFieldNames that should be applied to this mapping.
-
addNestedFieldTranslation
public void addNestedFieldTranslation(String attributeName, org.eclipse.persistence.internal.helper.DatabaseField sourceField, String aggregateFieldName)
PUBLIC: Map the name of an attribute of the reference descriptor mapped with AggregateCollectionMapping to aggregateToSourceFieldNames that should be applied to this mapping.- Specified by:
addNestedFieldTranslationin interfaceEmbeddableMapping
-
addNestedFieldNameTranslations
public void addNestedFieldNameTranslations(String attributeName, Map<String,org.eclipse.persistence.internal.helper.DatabaseField> map)
PUBLIC: Map the name of an attribute of the reference descriptor mapped with AggregateCollectionMapping to aggregateToSourceFields that should be applied to this mapping.
-
addTargetForeignKeyField
public void addTargetForeignKeyField(org.eclipse.persistence.internal.helper.DatabaseField targetForeignKey, org.eclipse.persistence.internal.helper.DatabaseField sourceKey)PUBLIC: Define the target foreign key relationship in the 1-M aggregate collection mapping. Both the target foreign key field and the source primary key field must be specified.- Overrides:
addTargetForeignKeyFieldin classForeignReferenceMapping
-
addTargetForeignKeyFieldName
public void addTargetForeignKeyFieldName(String targetForeignKey, 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.
-
buildBackupCloneForPartObject
public Object buildBackupCloneForPartObject(Object attributeValue, Object clone, Object backup, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork)
INTERNAL: Used during building the backup shallow copy to copy the vector without re-registering the target objects.- Overrides:
buildBackupCloneForPartObjectin classCollectionMapping
-
buildCloneForPartObject
public Object buildCloneForPartObject(Object attributeValue, Object original, org.eclipse.persistence.internal.identitymaps.CacheKey cacheKey, Object clone, org.eclipse.persistence.internal.sessions.AbstractSession cloningSession, Integer refreshCascade, boolean isExisting, boolean isFromSharedCache)
INTERNAL: Require for cloning, the part must be cloned. Ignore the objects, use the attribute value. this is identical to the super class except that the element must be added to the new aggregates collection so that the referenced objects will be cloned correctly- Overrides:
buildCloneForPartObjectin classCollectionMapping
-
buildElementClone
public Object buildElementClone(Object element, Object parent, org.eclipse.persistence.internal.identitymaps.CacheKey parentCacheKey, Integer refreshCascade, org.eclipse.persistence.internal.sessions.AbstractSession cloningSession, boolean isExisting, boolean isFromSharedCache)
INTERNAL: Clone the aggregate collection, if necessary.- Overrides:
buildElementClonein classCollectionMapping
-
buildExpression
public Expression buildExpression(Object queryObject, QueryByExamplePolicy policy, Expression expressionBuilder, Map processedObjects, org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: In case Query By Example is used, this method builds and returns an expression that corresponds to a single attribute and it's value.- Overrides:
buildExpressionin classCollectionMapping
-
collectQueryParameters
public void collectQueryParameters(Set<org.eclipse.persistence.internal.helper.DatabaseField> cacheFields)
INTERNAL: This method is used to store the FK fields that can be cached that correspond to noncacheable mappings the FK field values will be used to re-issue the query when cloning the shared cache entity- Overrides:
collectQueryParametersin classCollectionMapping
-
convertClassNamesToClasses
public void convertClassNamesToClasses(ClassLoader classLoader)
INTERNAL: Convert all the class-name-based settings in this mapping to actual class-based settings. This method is used when converting a project that has been built with class names to a project with classes.- Overrides:
convertClassNamesToClassesin classCollectionMapping- Parameters:
classLoader- Where to search for classes.
-
cascadeDiscoverAndPersistUnregisteredNewObjects
public void cascadeDiscoverAndPersistUnregisteredNewObjects(Object object, Map newObjects, Map unregisteredExistingObjects, Map visitedObjects, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, Set cascadeErrors)
INTERNAL: Cascade discover and persist new objects during commit.- Overrides:
cascadeDiscoverAndPersistUnregisteredNewObjectsin classCollectionMapping
-
cascadeRegisterNewIfRequired
public void cascadeRegisterNewIfRequired(Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, Map visitedObjects)
INTERNAL: Cascade registerNew for Create through mappings that require the cascade- Overrides:
cascadeRegisterNewIfRequiredin classCollectionMapping
-
cascadePerformRemoveIfRequired
public void cascadePerformRemoveIfRequired(Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, Map visitedObjects)
INTERNAL: Cascade registerNew for Create through mappings that require the cascade- Overrides:
cascadePerformRemoveIfRequiredin classCollectionMapping
-
cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired
public void cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired(Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, Map visitedObjects)
INTERNAL: Cascade perform removal of orphaned private owned objects from the UnitOfWorkChangeSet- Overrides:
cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequiredin classCollectionMapping
-
clone
public Object clone()
INTERNAL: The mapping clones itself to create deep copy.- Specified by:
clonein interfaceMapComponentMapping- Overrides:
clonein classCollectionMapping
-
compareForChange
public org.eclipse.persistence.internal.sessions.ChangeRecord compareForChange(Object clone, Object backUp, org.eclipse.persistence.internal.sessions.ObjectChangeSet owner, org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: This method is used to create a change record from comparing two aggregate collections- Overrides:
compareForChangein classCollectionMapping- Returns:
- ChangeRecord
-
compareObjects
public boolean compareObjects(Object firstObject, Object secondObject, org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Compare the attributes belonging to this mapping for the objects.- Overrides:
compareObjectsin classCollectionMapping
-
compareLists
public boolean compareLists(List firstList, List secondList, org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Compare the attributes belonging to this mapping for the objects.
-
createMapComponentFromRow
public Object createMapComponentFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord dbRow, ObjectBuildingQuery query, org.eclipse.persistence.internal.identitymaps.CacheKey parentCacheKey, org.eclipse.persistence.internal.sessions.AbstractSession session, boolean isTargetProtected)
INTERNAL Called when a DatabaseMapping is used to map the key in a collection. Returns the key.- Specified by:
createMapComponentFromRowin interfaceMapComponentMapping
-
getAggregateRow
public org.eclipse.persistence.internal.sessions.AbstractRecord getAggregateRow(ObjectLevelModifyQuery query, Object object)
INTERNAL: return the aggregate Record with the primary keys from the source table and target table
-
getReferenceDescriptor
public ClassDescriptor getReferenceDescriptor()
INTERNAL: Return the referenceDescriptor. This is a descriptor which is associated with the reference class. NOTE: If you are looking for the descriptor for a specific aggregate object, use #getReferenceDescriptor(Object). This will ensure you get the right descriptor if the object's descriptor is part of an inheritance tree.- Overrides:
getReferenceDescriptorin classForeignReferenceMapping
-
getReferenceDescriptor
public ClassDescriptor getReferenceDescriptor(Class theClass, org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: for inheritance purpose
-
getReferenceObjectKeys
public Vector getReferenceObjectKeys(ObjectLevelModifyQuery query) throws DatabaseException, OptimisticLockException
INTERNAL: get reference object keys
-
getSourceKeyFieldNames
public Vector getSourceKeyFieldNames()
PUBLIC: Return the source key field names associated with the mapping. These are in-order with the targetForeignKeyFieldNames.
-
getSourceKeyFields
public Vector<org.eclipse.persistence.internal.helper.DatabaseField> getSourceKeyFields()
INTERNAL: Return the source key names associated with the mapping
-
getTargetForeignKeyFieldNames
public Vector getTargetForeignKeyFieldNames()
PUBLIC: Return the target foregin key field names associated with the mapping. These are in-order with the sourceKeyFieldNames.
-
getTargetForeignKeyFields
public Vector<org.eclipse.persistence.internal.helper.DatabaseField> getTargetForeignKeyFields()
INTERNAL: Return the target foregin key fields associated with the mapping
-
getTargetForeignKeyToSourceKeys
public Map<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> getTargetForeignKeyToSourceKeys()
INTERNAL:
-
initialize
public void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorExceptionINTERNAL: For aggregate collection mapping the reference descriptor is cloned. The cloned descriptor is then assigned primary keys and table names before initialize. Once cloned descriptor is initialized it is assigned as reference descriptor in the aggregate mapping. This is very specific behavior for aggregate mappings. The original descriptor is used only for creating clones and after that mapping never uses it. Some initialization is done in postInitialize to ensure the target descriptor's references are initialized.- Overrides:
initializein classCollectionMapping- Throws:
DescriptorException
-
prepareNestedJoins
public ObjectLevelReadQuery prepareNestedJoins(org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, ObjectBuildingQuery baseQuery, org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Clone and prepare the JoinedAttributeManager nested JoinedAttributeManager. This is used for nested joining as the JoinedAttributeManager passed to the joined build object.- Overrides:
prepareNestedJoinsin classForeignReferenceMapping
-
initializeChildInheritance
public void initializeChildInheritance(ClassDescriptor parentDescriptor, org.eclipse.persistence.internal.sessions.AbstractSession session, HashMap<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> fieldTranslation, HashMap<org.eclipse.persistence.internal.helper.DatabaseTable,org.eclipse.persistence.internal.helper.DatabaseTable> tableTranslation) throws DescriptorException
INTERNAL: For aggregate mapping the reference descriptor is cloned. Also the involved inheritance descriptor, its children and parents all need to be cloned. The cloned descriptors are then assigned primary keys and table names before initialize. Once cloned descriptor is initialized it is assigned as reference descriptor in the aggregate mapping. This is very specific behavior for aggregate mappings. The original descriptor is used only for creating clones and after that mapping never uses it. Some initialization is done in postInitialize to ensure the target descriptor's references are initialized.- Throws:
DescriptorException
-
initializeParentInheritance
public void initializeParentInheritance(ClassDescriptor parentDescriptor, ClassDescriptor childDescriptor, org.eclipse.persistence.internal.sessions.AbstractSession session, HashMap<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> fieldTranslation, HashMap<org.eclipse.persistence.internal.helper.DatabaseTable,org.eclipse.persistence.internal.helper.DatabaseTable> tableTranslation) throws DescriptorException
INTERNAL: For aggregate mapping the reference descriptor is cloned. Also the involved inheritance descriptor, its children and parents all need to be cloned. The cloned descriptors are then assigned primary keys and table names before initialize. Once cloned descriptor is initialized it is assigned as reference descriptor in the aggregate mapping. This is very specific behavior for aggregate mappings. The original descriptor is used only for creating clones and after that mapping never uses it. Some initialization is done in postInitialize to ensure the target descriptor's references are initialized.- Throws:
DescriptorException
-
iterateOnElement
public void iterateOnElement(org.eclipse.persistence.internal.descriptors.DescriptorIterator iterator, Object element)INTERNAL: Iterate on the specified element.- Overrides:
iterateOnElementin classCollectionMapping
-
isAggregateCollectionMapping
public boolean isAggregateCollectionMapping()
INTERNAL:- Overrides:
isAggregateCollectionMappingin classDatabaseMapping
-
isElementCollectionMapping
public boolean isElementCollectionMapping()
INTERNAL:- Overrides:
isElementCollectionMappingin classDatabaseMapping
-
isJoiningSupported
public boolean isJoiningSupported()
INTERNAL: Return if this mapping support joining.- Overrides:
isJoiningSupportedin classForeignReferenceMapping
-
isOwned
public boolean isOwned()
INTERNAL:- Overrides:
isOwnedin classDatabaseMapping
-
load
public void load(Object object, org.eclipse.persistence.internal.queries.AttributeItem item, org.eclipse.persistence.internal.sessions.AbstractSession session, boolean fromFetchGroup)
Force instantiation of the load group.- Overrides:
loadin classCollectionMapping
-
loadAll
public void loadAll(Object object, org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.helper.IdentityHashSet loaded)
Force instantiation of all indirections.- Overrides:
loadAllin classCollectionMapping
-
mergeChangesIntoObject
public void mergeChangesIntoObject(Object target, org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord, Object source, org.eclipse.persistence.internal.sessions.MergeManager mergeManager, org.eclipse.persistence.internal.sessions.AbstractSession targetSession)
INTERNAL: Merge changes from the source to the target object. Because this is a collection mapping, values are added to or removed from the collection based on the changeset- Overrides:
mergeChangesIntoObjectin classCollectionMapping
-
mergeIntoObject
public void mergeIntoObject(Object target, boolean isTargetUnInitialized, Object source, org.eclipse.persistence.internal.sessions.MergeManager mergeManager, org.eclipse.persistence.internal.sessions.AbstractSession targetSession)
INTERNAL: Merge changes from the source to the target object.- Overrides:
mergeIntoObjectin classCollectionMapping
-
postInitialize
public void postInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorExceptionINTERNAL: For aggregate collection mapping the reference descriptor is cloned. The cloned descriptor is then assigned primary keys and table names before initialize. Once the cloned descriptor is initialized it is assigned as reference descriptor in the aggregate mapping. This is a very specific behavior for aggregate mappings. The original descriptor is used only for creating clones and after that the aggregate mapping never uses it. Some initialization is done in postInitialize to ensure the target descriptor's references are initialized.- Overrides:
postInitializein classCollectionMapping- Throws:
DescriptorException
-
postInsert
public void postInsert(WriteObjectQuery query) throws DatabaseException, OptimisticLockException
INTERNAL: Insert privately owned parts- Overrides:
postInsertin classCollectionMapping- Throws:
DatabaseExceptionOptimisticLockException
-
postUpdate
public void postUpdate(WriteObjectQuery writeQuery) throws DatabaseException, OptimisticLockException
INTERNAL: Update the privately owned parts- Overrides:
postUpdatein classDatabaseMapping- Throws:
DatabaseExceptionOptimisticLockException
-
preDelete
public void preDelete(DeleteObjectQuery query) throws DatabaseException, OptimisticLockException
INTERNAL: Delete privately owned parts- Overrides:
preDeletein classDatabaseMapping- Throws:
DatabaseExceptionOptimisticLockException
-
preInsert
public void preInsert(WriteObjectQuery query) throws DatabaseException, OptimisticLockException
INTERNAL: The message is passed to its reference class descriptor.- Overrides:
preInsertin classCollectionMapping- Throws:
DatabaseExceptionOptimisticLockException
-
getAndPrepareModifyQueryForInsert
public InsertObjectQuery getAndPrepareModifyQueryForInsert(ObjectLevelModifyQuery originalQuery, Object object)
INTERNAL: setup the modifyQuery for post insert/update and pre delete
-
prepareModifyQueryForDelete
public void prepareModifyQueryForDelete(ObjectLevelModifyQuery originalQuery, ObjectLevelModifyQuery modifyQuery, Object wrappedObject, Map extraData)
INTERNAL: setup the modifyQuery for pre delete
-
prepareModifyQueryForUpdate
public void prepareModifyQueryForUpdate(ObjectLevelModifyQuery originalQuery, ObjectLevelModifyQuery modifyQuery, Object object)
INTERNAL: setup the modifyQuery for update,
-
setSourceKeyFieldNames
public void setSourceKeyFieldNames(Vector fieldNames)
PUBLIC: Set the source key field names associated with the mapping. These must be in-order with the targetForeignKeyFieldNames.
-
setSourceKeyFields
public void setSourceKeyFields(Vector<org.eclipse.persistence.internal.helper.DatabaseField> sourceKeyFields)
INTERNAL: set all the primary key names associated with this mapping
-
setTargetForeignKeyFieldNames
public void setTargetForeignKeyFieldNames(Vector fieldNames)
PUBLIC: Set the target foregin key field names associated with the mapping. These must be in-order with the sourceKeyFieldNames.
-
setTargetForeignKeyFields
public void setTargetForeignKeyFields(Vector<org.eclipse.persistence.internal.helper.DatabaseField> targetForeignKeyFields)
INTERNAL: set the target foregin key fields associated with the mapping
-
simpleAddToCollectionChangeRecord
public void simpleAddToCollectionChangeRecord(Object referenceKey, Object changeSetToAdd, org.eclipse.persistence.internal.sessions.ObjectChangeSet changeSet, org.eclipse.persistence.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. PLEASE ENSURE that the changes have been made in the object model first.- Overrides:
simpleAddToCollectionChangeRecordin classCollectionMapping
-
simpleRemoveFromCollectionChangeRecord
public void simpleRemoveFromCollectionChangeRecord(Object referenceKey, Object changeSetToRemove, org.eclipse.persistence.internal.sessions.ObjectChangeSet changeSet, org.eclipse.persistence.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. PLEASE ENSURE that the changes have been made in the object model first.- Overrides:
simpleRemoveFromCollectionChangeRecordin classCollectionMapping
-
verifyDelete
public boolean verifyDelete(Object object, org.eclipse.persistence.internal.sessions.AbstractSession session) throws DatabaseException
INTERNAL: Checks if object is deleted from the database or not.- Overrides:
verifyDeletein classCollectionMapping- Throws:
DatabaseException
-
isCandidateForPrivateOwnedRemoval
public boolean isCandidateForPrivateOwnedRemoval()
INTERNAL: AggregateCollection contents should not be considered for addition to the UnitOfWork private owned objects list for removal.- Overrides:
isCandidateForPrivateOwnedRemovalin classDatabaseMapping
-
isCascadedLockingSupported
public boolean isCascadedLockingSupported()
INTERNAL Return true if this mapping supports cascaded version optimistic locking.- Overrides:
isCascadedLockingSupportedin classDatabaseMapping
-
isChangeTrackingSupported
public boolean isChangeTrackingSupported(Project project)
INTERNAL: Return if this mapping supports change tracking.- Overrides:
isChangeTrackingSupportedin classCollectionMapping
-
remoteInitialization
public void remoteInitialization(DistributedSession session)
INTERNAL: Once a descriptor is serialized to the remote session, all its mappings and reference descriptors are traversed. Usually the mappings are initialized and the serialized reference descriptors are replaced with local descriptors if they already exist in the remote session.- Overrides:
remoteInitializationin classForeignReferenceMapping
-
isListOrderFieldUpdatable
public boolean isListOrderFieldUpdatable()
PUBLIC: indicates whether listOrderField value could be updated in the db. Used only if listOrderField!=null
-
setIsListOrderFieldUpdatable
public void setIsListOrderFieldUpdatable(boolean isUpdatable)
PUBLIC: indicates whether listOrderField value could be updated in the db. Used only if listOrderField!=null Default value is true.
-
setDefaultSourceTable
public void setDefaultSourceTable(org.eclipse.persistence.internal.helper.DatabaseTable table)
PUBLIC: Set a default source table to use with the source fields of this mapping.
-
hasNestedIdentityReference
public boolean hasNestedIdentityReference()
INTERNAL: Indicates whether the mapping (or at least one of its nested mappings, at any nested depth) references an entity. To return true the mapping (or nested mapping) should be ForeignReferenceMapping with non-null and non-aggregate reference descriptor.- Overrides:
hasNestedIdentityReferencein classForeignReferenceMapping
-
-