EclipseLink 1.1.4, build 'v20100812-r7860' API Reference

org.eclipse.persistence.mappings
Class AggregateCollectionMapping

java.lang.Object
  extended by org.eclipse.persistence.mappings.DatabaseMapping
      extended by org.eclipse.persistence.mappings.ForeignReferenceMapping
          extended by org.eclipse.persistence.mappings.CollectionMapping
              extended by org.eclipse.persistence.mappings.AggregateCollectionMapping
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, ContainerMapping, MapComponentMapping, RelationalMapping

public class AggregateCollectionMapping
extends CollectionMapping
implements RelationalMapping, MapComponentMapping

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.

See Also:
Serialized Form
Author:
King (Yaoping) Wang
Since:
TOPLink/Java 3.0

Field Summary
protected  java.util.Map<java.lang.String,java.lang.String> aggregateToSourceFieldNames
          Map the name of a field in the aggregate collection descriptor to a field in the actual table specified in the mapping.
protected  java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> nestedAggregateToSourceFieldNames
          Map the name of an attribute of the reference descriptor mapped with AggregateCollectionMapping to aggregateToSourceFieldNames that should be applied to this mapping.
protected  ClassDescriptor remoteReferenceDescriptor
          In RemoteSession case the mapping needs the reference descriptor serialized from the server, but referenceDescriptor attribute defined as transient in the superclass.
protected  java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> sourceKeyFields
          This is a primary key in the source table that is used as foreign key in the target table
protected  java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> targetForeignKeyFields
          This is a key in the target table which is a foreign key in the target table.
protected  java.util.Map<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> targetForeignKeyToSourceKeys
          Foreign keys in the target table to the related keys in the source table
 
Fields inherited from class org.eclipse.persistence.mappings.CollectionMapping
containerPolicy, deleteAllQuery, hasCustomDeleteAllQuery, hasOrderBy
 
Fields inherited from class org.eclipse.persistence.mappings.ForeignReferenceMapping
cascadeMerge, cascadePersist, cascadeRefresh, cascadeRemove, forceInitializationOfSelectionCriteria, hasCustomSelectionQuery, indirectionPolicy, INNER_JOIN, isPrivateOwned, joinFetch, NONE, OUTER_JOIN, referenceClass, referenceClassName, referenceDescriptor, relationshipPartner, relationshipPartnerAttributeName, requiresTransientWeavedFields, selectionQuery, tempInitSession, usesBatchReading
 
Fields inherited from class org.eclipse.persistence.mappings.DatabaseMapping
attributeAccessor, attributeName, descriptor, fields, isLazy, isOptional, isPrimaryKeyMapping, isReadOnly, isRemotelyInitialized, NO_FIELDS, NO_WEIGHT, properties, weight, WEIGHT_1
 
Constructor Summary
AggregateCollectionMapping()
          PUBLIC: Default constructor.
 
Method Summary
 void addFieldNameTranslation(java.lang.String sourceFieldName, java.lang.String aggregateFieldName)
          PUBLIC: Maps a field name in the aggregate descriptor to a field name in the source table.
 void addFieldNameTranslations(java.util.Map<java.lang.String,java.lang.String> map)
          PUBLIC: Maps a field name in the aggregate descriptor to a field name in the source table.
 void addNestedFieldNameTranslation(java.lang.String attributeName, java.lang.String sourceFieldName, java.lang.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.
 void addNestedFieldNameTranslations(java.lang.String attributeName, java.util.Map<java.lang.String,java.lang.String> map)
          PUBLIC: Map the name of an attribute of the reference descriptor mapped with AggregateCollectionMapping to aggregateToSourceFieldNames that should be applied to this mapping.
 void addTargetForeignKeyFieldName(java.lang.String targetForeignKey, java.lang.String sourceKey)
          PUBLIC: Define the target foreign key relationship in the 1-M aggregate collection mapping.
 void addToCollectionChangeRecord(java.lang.Object newKey, java.lang.Object newValue, org.eclipse.persistence.internal.sessions.ObjectChangeSet objectChangeSet, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)
          INTERNAL: Add a new value and its change set to the collection change record.
 java.lang.Object buildBackupCloneForPartObject(java.lang.Object attributeValue, java.lang.Object clone, java.lang.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.
 java.lang.Object buildCloneForPartObject(java.lang.Object attributeValue, java.lang.Object original, java.lang.Object clone, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork, boolean isExisting)
          INTERNAL: Require for cloning, the part must be cloned.
protected  java.lang.Object buildElementBackupClone(java.lang.Object element, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork)
          INTERNAL: Clone the aggregate collection, if necessary.
protected  java.lang.Object buildElementClone(java.lang.Object element, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork, boolean isExisting)
          INTERNAL: Clone the aggregate collection, if necessary.
 void cascadeDiscoverAndPersistUnregisteredNewObjects(java.lang.Object object, java.util.Map newObjects, java.util.Map unregisteredExistingObjects, java.util.Map visitedObjects, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)
          INTERNAL: Cascade discover and persist new objects during commit.
 void cascadePerformRemoveIfRequired(java.lang.Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, java.util.Map visitedObjects)
          INTERNAL: Cascade registerNew for Create through mappings that require the cascade
 void cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired(java.lang.Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, java.util.Map visitedObjects)
          INTERNAL: Cascade perform removal of orphaned private owned objects from the UnitOfWorkChangeSet
 void cascadeRegisterNewIfRequired(java.lang.Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, java.util.Map visitedObjects)
          INTERNAL: Cascade registerNew for Create through mappings that require the cascade
 java.lang.Object clone()
          INTERNAL: The mapping clones itself to create deep copy.
 org.eclipse.persistence.internal.sessions.ChangeRecord compareForChange(java.lang.Object clone, java.lang.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
 boolean compareObjects(java.lang.Object firstObject, java.lang.Object secondObject, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Compare the attributes belonging to this mapping for the objects.
protected  org.eclipse.persistence.internal.sessions.ChangeRecord convertToChangeRecord(java.lang.Object cloneCollection, org.eclipse.persistence.internal.sessions.ObjectChangeSet owner, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: This method is used to convert the contents of an aggregateCollection into a changeRecord
protected  void deleteAll(DeleteObjectQuery query, java.lang.Object elements)
          To delete all the entries matching the selection criteria from the table stored in the referenced descriptor
protected  void executeEvent(int eventCode, ObjectLevelModifyQuery query)
          INTERNAL: Execute a descriptor event for the specified event code.
protected  java.util.Vector extractKeyFromTargetRow(org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Extract the source primary key value from the target row.
protected  java.util.Vector extractPrimaryKeyFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Extract the primary key value from the source row.
 java.lang.Object extractResultFromBatchQuery(DatabaseQuery query, org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow, org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.sessions.AbstractRecord argumentRow)
          INTERNAL: Extract the value from the batch optimized query.
 org.eclipse.persistence.internal.sessions.AbstractRecord getAggregateRow(ObjectLevelModifyQuery query, java.lang.Object object)
          INTERNAL: return the aggregate Record with the primary keys from the source table and target table
 InsertObjectQuery getAndPrepareModifyQueryForInsert(ObjectLevelModifyQuery originalQuery, java.lang.Object object)
          INTERNAL: setup the modifyQuery for post insert/update and pre delete
protected  Expression getDeleteAllCriteria(org.eclipse.persistence.internal.sessions.AbstractSession session)
          Delete all criteria is created with target foreign keys and source keys.
protected  InsertObjectQuery getInsertObjectQuery(org.eclipse.persistence.internal.sessions.AbstractSession session, ClassDescriptor desc)
          INTERNAL: Returns clone of InsertObjectQuery from the reference descriptor, if it is not set - create it.
 ClassDescriptor getReferenceDescriptor()
          INTERNAL: Return the referenceDescriptor.
 ClassDescriptor getReferenceDescriptor(java.lang.Class theClass, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: for inheritance purpose
 java.util.Vector getReferenceObjectKeys(ObjectLevelModifyQuery query)
          INTERNAL: get reference object keys
 java.util.Vector getSourceKeyFieldNames()
          PUBLIC: Return the source key field names associated with the mapping.
 java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> getSourceKeyFields()
          INTERNAL: Return the source key names associated with the mapping
 java.util.Vector getTargetForeignKeyFieldNames()
          PUBLIC: Return the target foregin key field names associated with the mapping.
 java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> getTargetForeignKeyFields()
          INTERNAL: Return the target foregin key fields associated with the mapping
 java.util.Map<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> getTargetForeignKeyToSourceKeys()
          INTERNAL:
 void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: For aggregate collection mapping the reference descriptor is cloned.
 void initializeChildInheritance(ClassDescriptor parentDescriptor, org.eclipse.persistence.internal.sessions.AbstractSession session, java.util.HashMap<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> fieldTranslation, java.util.HashMap<org.eclipse.persistence.internal.helper.DatabaseTable,org.eclipse.persistence.internal.helper.DatabaseTable> tableTranslation)
          INTERNAL: For aggregate mapping the reference descriptor is cloned.
protected  void initializeDeleteAllQuery(org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Initialize delete all query.
 void initializeParentInheritance(ClassDescriptor parentDescriptor, ClassDescriptor childDescriptor, org.eclipse.persistence.internal.sessions.AbstractSession session, java.util.HashMap<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> fieldTranslation, java.util.HashMap<org.eclipse.persistence.internal.helper.DatabaseTable,org.eclipse.persistence.internal.helper.DatabaseTable> tableTranslation)
          INTERNAL: For aggregate mapping the reference descriptor is cloned.
protected  void initializeReferenceDescriptor(org.eclipse.persistence.internal.sessions.AbstractSession session)
          Initialize and set the descriptor for the referenced class in this mapping.
protected  void initializeSelectionCriteria(org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Selection criteria is created with target foreign keys and source keys.
protected  void initializeTargetForeignKeyToSourceKeys(org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: The foreign keys and the primary key names are converted to DatabaseFields and stored.
protected  void initializeTargetForeignKeyToSourceKeysWithDefaults(org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: The foreign keys and the primary key names are converted to DatabaseFields and stored.
 boolean isAggregateCollectionMapping()
          INTERNAL:
 boolean isCandidateForPrivateOwnedRemoval()
          INTERNAL: AggregateCollection contents should not be considered for addition to the UnitOfWork private owned objects list for removal.
 boolean isCascadedLockingSupported()
          INTERNAL Return true if this mapping supports cascaded version optimistic locking.
 boolean isChangeTrackingSupported(Project project)
          INTERNAL: Return if this mapping supports change tracking.
 boolean isJoiningSupported()
          INTERNAL: Return if this mapping support joining.
 boolean isPrivateOwned()
          INTERNAL:
 boolean isRelationalMapping()
          INTERNAL:
protected  boolean isSourceKeySpecified()
          Checks if source key is specified or not.
 void iterateOnElement(org.eclipse.persistence.internal.descriptors.DescriptorIterator iterator, java.lang.Object element)
          INTERNAL: Iterate on the specified element.
 void mergeChangesIntoObject(java.lang.Object target, org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord, java.lang.Object source, org.eclipse.persistence.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, org.eclipse.persistence.internal.sessions.MergeManager mergeManager)
          INTERNAL: Merge changes from the source to the target object.
protected  void objectAddedDuringUpdate(ObjectLevelModifyQuery query, java.lang.Object objectAdded, org.eclipse.persistence.internal.sessions.ObjectChangeSet changeSet)
          INTERNAL: An object was added to the collection during an update, insert it if private.
protected  void objectRemovedDuringUpdate(ObjectLevelModifyQuery query, java.lang.Object objectDeleted)
          INTERNAL: An object was removed to the collection during an update, delete it if private.
protected  void objectUnchangedDuringUpdate(ObjectLevelModifyQuery query, java.lang.Object object, java.util.Hashtable backupCloneKeyedCache, org.eclipse.persistence.internal.identitymaps.CacheKey cachedKey)
          INTERNAL: An object is still in the collection, update it as it may have changed.
 void postInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: For aggregate collection mapping the reference descriptor is cloned.
 void postInsert(WriteObjectQuery query)
          INTERNAL: Insert privately owned parts
protected  void postPrepareNestedBatchQuery(ReadQuery batchQuery, ReadAllQuery query)
          INTERNAL: Allow the mapping the do any further batch preparation.
 void postUpdate(WriteObjectQuery writeQuery)
          INTERNAL: Update the privately owned parts
 void preDelete(DeleteObjectQuery query)
          INTERNAL: Delete privately owned parts
 void preInsert(WriteObjectQuery query)
          INTERNAL: The message is passed to its reference class descriptor.
 void prepareModifyQueryForDelete(ObjectLevelModifyQuery originalQuery, ObjectLevelModifyQuery modifyQuery, java.lang.Object object)
          INTERNAL: setup the modifyQuery for pre delete
 void prepareModifyQueryForUpdate(ObjectLevelModifyQuery originalQuery, ObjectLevelModifyQuery modifyQuery, java.lang.Object object)
          INTERNAL: setup the modifyQuery for update,
 void remoteInitialization(DistributedSession session)
          INTERNAL: Once a descriptor is serialized to the remote session, all its mappings and reference descriptors are traversed.
 void removeFromCollectionChangeRecord(java.lang.Object newKey, java.lang.Object newValue, org.eclipse.persistence.internal.sessions.ObjectChangeSet objectChangeSet, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)
          INTERNAL: Remove a value and its change set from the collection change record.
protected  void setReferenceDescriptor(ClassDescriptor aDescriptor)
          INTERNAL: Set the referenceDescriptor.
 void setSourceKeyFieldNames(java.util.Vector fieldNames)
          PUBLIC: Set the source key field names associated with the mapping.
 void setSourceKeyFields(java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> sourceKeyFields)
          INTERNAL: set all the primary key names associated with this mapping
 void setTargetForeignKeyFieldNames(java.util.Vector fieldNames)
          PUBLIC: Set the target foregin key field names associated with the mapping.
 void setTargetForeignKeyFields(java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> targetForeignKeyFields)
          INTERNAL: set the target foregin key fields associated with the mapping
protected  void setTargetForeignKeyToSourceKeys(java.util.Map<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> targetForeignKeyToSourceKeys)
           
protected  boolean shouldObjectModifyCascadeToParts(ObjectLevelModifyQuery query)
          Returns true as any process leading to object modification should also affect its privately owned parts Usually used by write, insert, update and delete.
 void simpleAddToCollectionChangeRecord(java.lang.Object referenceKey, java.lang.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.
 void simpleRemoveFromCollectionChangeRecord(java.lang.Object referenceKey, java.lang.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.
protected  void translateFields(ClassDescriptor clonedDescriptor, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: If field names are different in the source and aggregate objects then the translation is done here.
protected static void translateTablesAndFields(ClassDescriptor descriptor, java.util.HashMap<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> fieldTranslation, java.util.HashMap<org.eclipse.persistence.internal.helper.DatabaseTable,org.eclipse.persistence.internal.helper.DatabaseTable> tableTranslation)
          INTERNAL: Called in case fieldTranslation !
protected  void updateNestedAggregateCollectionMappings(ClassDescriptor descriptor)
          INTERNAL: Called in case nestedAggregateToSourceFieldNames !
 java.lang.Object valueFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, ObjectBuildingQuery sourceQuery, org.eclipse.persistence.internal.sessions.AbstractSession executionSession)
          INTERNAL: Retrieves a value from the row for a particular query key
 boolean verifyDelete(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Checks if object is deleted from the database or not.
protected  void verifyDeleteForUpdate(DeleteObjectQuery query)
          Verifying deletes make sure that all the records privately owned by this mapping are actually removed.
 
Methods inherited from class org.eclipse.persistence.mappings.CollectionMapping
addAggregateOrderBy, addAscendingOrdering, addDescendingOrdering, addOrderBy, buildChangeRecord, buildCopy, buildReferencesPKList, calculateDeferredChanges, cascadeMerge, compareCollectionsForChange, compareObjectsAndWrite, compareObjectsWithoutPrivateOwned, compareObjectsWithPrivateOwned, convertClassNamesToClasses, fixRealObjectReferences, getContainerPolicy, getDeleteAllQuery, getObjectCorrespondingTo, getOrderByQueryKeyExpressions, getRealCollectionAttributeValueFromObject, hasCustomDeleteAllQuery, hasOrderBy, isAttributeValueInstantiatedOrChanged, isCollectionMapping, iterateOnRealAttributeValue, mustDeleteReferenceObjectsOneByOne, objectUnchangedDuringUpdate, prepareTranslationRow, readPrivateOwnedForObject, replaceValueHoldersIn, setChangeListener, setContainerPolicy, setCustomDeleteAllQuery, setDeleteAllCall, setDeleteAllQuery, setDeleteAllSQLString, setHasCustomDeleteAllQuery, setSelectionQueryContainerPolicy, setSessionName, updateChangeRecord, updateCollectionChangeRecord, useCollectionClass, useCollectionClassName, useListClassName, useMapClass, useMapClass, useMapClassName, useSortedSetClass, useSortedSetClassName, useSortedSetClassName, useTransparentCollection, useTransparentList, useTransparentMap, useTransparentSet, validateBeforeInitialization, valueFromPKList, valueFromRowInternalWithJoin
 
Methods inherited from class org.eclipse.persistence.mappings.ForeignReferenceMapping
batchedValueFromRow, buildBackupClone, buildClone, buildCloneFromRow, createUnitOfWorkValueHolder, dontDoMerge, dontUseBatchReading, dontUseIndirection, fixObjectReferences, getAttributeValueFromObject, getAttributeValueWithClonedValueHolders, getBatchReadObjects, getIndirectionPolicy, getJoinCriteria, getJoinFetch, getRealAttributeValueFromAttribute, getReferenceClass, getReferenceClassName, getRelationshipPartner, getRelationshipPartnerAttributeName, getSelectionCriteria, getSelectionQuery, getTempSession, getValueFromRemoteValueHolder, hasCustomSelectionQuery, initializeSelectionQuery, instantiateAttribute, isAttributeValueInstantiated, isCascadeMerge, isCascadePersist, isCascadeRefresh, isCascadeRemove, isForeignReferenceMapping, isInnerJoinFetched, isJoinFetched, isLazy, isOuterJoinFetched, iterate, mergeRemoteValueHolder, preInitialize, prepareHistoricalQuery, prepareNestedBatchQuery, prepareNestedJoinQueryClone, prepareNestedJoins, privateOwnedRelationship, requiresTransientWeavedFields, setBatchReadObjects, setCascadeAll, setCascadeMerge, setCascadePersist, setCascadeRefresh, setCascadeRemove, setCustomSelectionQuery, setForceInitializationOfSelectionCriteria, setHasCustomSelectionQuery, setIndirectionPolicy, setIsPrivateOwned, setJoinFetch, setRealAttributeValueInObject, setReferenceClass, setReferenceClassName, setRelationshipPartner, setRelationshipPartnerAttributeName, setRequiresTransientWeavedFields, setSelectionCall, setSelectionCriteria, setSelectionQuery, setSelectionSQLString, setTempSession, setUsesBatchReading, setUsesIndirection, shouldForceInitializationOfSelectionCriteria, shouldInitializeSelectionCriteria, shouldMergeCascadeParts, shouldMergeCascadeReference, shouldUseBatchReading, shouldUseValueFromRowWithJoin, trimRowForJoin, trimRowForJoin, useBasicIndirection, useBatchReading, useContainerIndirection, useInnerJoinFetch, useOuterJoinFetch, usesIndirection, useWeavedIndirection, valueFromRowInternal
 
Methods inherited from class org.eclipse.persistence.mappings.DatabaseMapping
buildExpression, buildObjectJoinExpression, buildObjectJoinExpression, buildShallowOriginalFromRow, cloneFields, collectFields, extractNestedExpressions, getAttributeAccessor, getAttributeClassification, getAttributeName, getDescriptor, getField, getFieldClassification, getFields, getGetMethodName, getProperties, getProperty, getRealAttributeValueFromObject, getSelectFields, getSelectTables, getSetMethodName, getWeight, hasConstraintDependency, hasDependency, hasInverseConstraintDependency, hasRootExpressionThatShouldUseOuterJoin, isAbstractCompositeCollectionMapping, isAbstractCompositeDirectCollectionMapping, isAbstractCompositeObjectMapping, isAbstractDirectMapping, isAggregateMapping, isAggregateObjectMapping, isCloningRequired, isDatabaseMapping, isDirectCollectionMapping, isDirectMapMapping, isDirectToFieldMapping, isDirectToXMLTypeMapping, isEISMapping, isManyToManyMapping, isNestedTableMapping, isObjectReferenceMapping, isOneToManyMapping, isOneToOneMapping, isOptional, isPrimaryKeyMapping, isReadOnly, isReferenceMapping, isRemotelyInitialized, isStructureMapping, isTransformationMapping, isUnidirectionalOneToManyMapping, isUsingMethodAccess, isVariableOneToOneMapping, isWriteOnly, isXMLMapping, performDataModificationEvent, postCalculateChanges, postCalculateChangesOnDeleted, postDelete, prepareCascadeLockingPolicy, preUpdate, readFromResultSetIntoObject, readFromRowIntoObject, readOnly, readWrite, rehashFieldDependancies, remotelyInitialized, setAttributeAccessor, setAttributeName, setAttributeValueInObject, setDescriptor, setFields, setGetMethodName, setIsLazy, setIsOptional, setIsPrimaryKeyMapping, setIsReadOnly, setProperties, setProperty, setSetMethodName, setWeight, toString, validateAfterInitialization, valueFromObject, valueFromResultSet, valueFromRow, writeFromAttributeIntoRow, writeFromObjectIntoRow, writeFromObjectIntoRowForShallowInsert, writeFromObjectIntoRowForShallowInsertWithChangeRecord, writeFromObjectIntoRowForUpdate, writeFromObjectIntoRowForWhereClause, writeFromObjectIntoRowWithChangeRecord, writeInsertFieldsIntoRow, writeUpdateFieldsIntoRow
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

targetForeignKeyFields

protected transient java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> targetForeignKeyFields
This is a key in the target table which is a foreign key in the target table.


sourceKeyFields

protected transient java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> sourceKeyFields
This is a primary key in the source table that is used as foreign key in the target table


targetForeignKeyToSourceKeys

protected transient java.util.Map<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> targetForeignKeyToSourceKeys
Foreign keys in the target table to the related keys in the source table


aggregateToSourceFieldNames

protected transient java.util.Map<java.lang.String,java.lang.String> aggregateToSourceFieldNames
Map the name of a field in the aggregate collection descriptor to a field in the actual table specified in the mapping.


nestedAggregateToSourceFieldNames

protected transient java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> nestedAggregateToSourceFieldNames
Map the name of an attribute of the reference descriptor mapped with AggregateCollectionMapping to aggregateToSourceFieldNames that should be applied to this mapping.


remoteReferenceDescriptor

protected ClassDescriptor remoteReferenceDescriptor
In RemoteSession case the mapping needs the reference descriptor serialized from the server, but referenceDescriptor attribute defined as transient in the superclass. To overcome that in non-remote case referenceDescriptor is assigned to remoteReferenceDescriptor; in remote - another way around.

Constructor Detail

AggregateCollectionMapping

public AggregateCollectionMapping()
PUBLIC: Default constructor.

Method Detail

isRelationalMapping

public boolean isRelationalMapping()
INTERNAL:

Overrides:
isRelationalMapping in class DatabaseMapping

addFieldNameTranslation

public void addFieldNameTranslation(java.lang.String sourceFieldName,
                                    java.lang.String aggregateFieldName)
PUBLIC: Maps a field name in the aggregate descriptor to a field name in the source table.


addFieldNameTranslations

public void addFieldNameTranslations(java.util.Map<java.lang.String,java.lang.String> map)
PUBLIC: Maps a field name in the aggregate descriptor to a field name in the source table.


addNestedFieldNameTranslation

public void addNestedFieldNameTranslation(java.lang.String attributeName,
                                          java.lang.String sourceFieldName,
                                          java.lang.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.


addNestedFieldNameTranslations

public void addNestedFieldNameTranslations(java.lang.String attributeName,
                                           java.util.Map<java.lang.String,java.lang.String> map)
PUBLIC: Map the name of an attribute of the reference descriptor mapped with AggregateCollectionMapping to aggregateToSourceFieldNames that should be applied to this mapping.


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.


buildBackupCloneForPartObject

public java.lang.Object buildBackupCloneForPartObject(java.lang.Object attributeValue,
                                                      java.lang.Object clone,
                                                      java.lang.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:
buildBackupCloneForPartObject in class CollectionMapping

buildCloneForPartObject

public java.lang.Object buildCloneForPartObject(java.lang.Object attributeValue,
                                                java.lang.Object original,
                                                java.lang.Object clone,
                                                org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork,
                                                boolean isExisting)
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 clonned correctly

Overrides:
buildCloneForPartObject in class CollectionMapping

buildElementBackupClone

protected java.lang.Object buildElementBackupClone(java.lang.Object element,
                                                   org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork)
INTERNAL: Clone the aggregate collection, if necessary.


buildElementClone

protected java.lang.Object buildElementClone(java.lang.Object element,
                                             org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork,
                                             boolean isExisting)
INTERNAL: Clone the aggregate collection, if necessary.

Overrides:
buildElementClone in class CollectionMapping

cascadeDiscoverAndPersistUnregisteredNewObjects

public void cascadeDiscoverAndPersistUnregisteredNewObjects(java.lang.Object object,
                                                            java.util.Map newObjects,
                                                            java.util.Map unregisteredExistingObjects,
                                                            java.util.Map visitedObjects,
                                                            org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)
INTERNAL: Cascade discover and persist new objects during commit.

Overrides:
cascadeDiscoverAndPersistUnregisteredNewObjects in class CollectionMapping

cascadeRegisterNewIfRequired

public void cascadeRegisterNewIfRequired(java.lang.Object object,
                                         org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow,
                                         java.util.Map visitedObjects)
INTERNAL: Cascade registerNew for Create through mappings that require the cascade

Overrides:
cascadeRegisterNewIfRequired in class CollectionMapping

cascadePerformRemoveIfRequired

public void cascadePerformRemoveIfRequired(java.lang.Object object,
                                           org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow,
                                           java.util.Map visitedObjects)
INTERNAL: Cascade registerNew for Create through mappings that require the cascade

Overrides:
cascadePerformRemoveIfRequired in class CollectionMapping

cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired

public void cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired(java.lang.Object object,
                                                                          org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow,
                                                                          java.util.Map visitedObjects)
INTERNAL: Cascade perform removal of orphaned private owned objects from the UnitOfWorkChangeSet

Overrides:
cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired in class CollectionMapping

clone

public java.lang.Object clone()
INTERNAL: The mapping clones itself to create deep copy.

Overrides:
clone in class CollectionMapping

compareForChange

public org.eclipse.persistence.internal.sessions.ChangeRecord compareForChange(java.lang.Object clone,
                                                                               java.lang.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:
compareForChange in class CollectionMapping
Returns:
ChangeRecord

compareObjects

public boolean compareObjects(java.lang.Object firstObject,
                              java.lang.Object secondObject,
                              org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Compare the attributes belonging to this mapping for the objects.

Overrides:
compareObjects in class CollectionMapping

convertToChangeRecord

protected org.eclipse.persistence.internal.sessions.ChangeRecord convertToChangeRecord(java.lang.Object cloneCollection,
                                                                                       org.eclipse.persistence.internal.sessions.ObjectChangeSet owner,
                                                                                       org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: This method is used to convert the contents of an aggregateCollection into a changeRecord

Parameters:
owner - org.eclipse.persistence.internal.sessions.ObjectChangeSet the ChangeSet that uses this record
cloneCollection - Object the collection to convert
session - org.eclipse.persistence.internal.sessions.AbstractSession
Returns:
org.eclipse.persistence.internal.sessions.AggregateCollectionChangeRecord the changerecord representing this AggregateCollectionMapping

deleteAll

protected void deleteAll(DeleteObjectQuery query,
                         java.lang.Object elements)
                  throws DatabaseException
To delete all the entries matching the selection criteria from the table stored in the referenced descriptor

Throws:
DatabaseException

executeEvent

protected void executeEvent(int eventCode,
                            ObjectLevelModifyQuery query)
INTERNAL: Execute a descriptor event for the specified event code.


extractKeyFromTargetRow

protected java.util.Vector extractKeyFromTargetRow(org.eclipse.persistence.internal.sessions.AbstractRecord row,
                                                   org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Extract the source primary key value from the target row. Used for batch reading, most following same order and fields as in the mapping.


extractPrimaryKeyFromRow

protected java.util.Vector extractPrimaryKeyFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row,
                                                    org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Extract the primary key value from the source row. Used for batch reading, most following same order and fields as in the mapping.


postPrepareNestedBatchQuery

protected void postPrepareNestedBatchQuery(ReadQuery batchQuery,
                                           ReadAllQuery query)
INTERNAL: Allow the mapping the do any further batch preparation.

Overrides:
postPrepareNestedBatchQuery in class ForeignReferenceMapping

extractResultFromBatchQuery

public java.lang.Object extractResultFromBatchQuery(DatabaseQuery query,
                                                    org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow,
                                                    org.eclipse.persistence.internal.sessions.AbstractSession session,
                                                    org.eclipse.persistence.internal.sessions.AbstractRecord argumentRow)
INTERNAL: Extract the value from the batch optimized query.

Overrides:
extractResultFromBatchQuery in class ForeignReferenceMapping

getAggregateRow

public org.eclipse.persistence.internal.sessions.AbstractRecord getAggregateRow(ObjectLevelModifyQuery query,
                                                                                java.lang.Object object)
INTERNAL: return the aggregate Record with the primary keys from the source table and target table


getDeleteAllCriteria

protected Expression getDeleteAllCriteria(org.eclipse.persistence.internal.sessions.AbstractSession session)
Delete all criteria is created with target foreign keys and source keys. This criteria is then used to delete target records from the 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:
getReferenceDescriptor in class ForeignReferenceMapping

getReferenceDescriptor

public ClassDescriptor getReferenceDescriptor(java.lang.Class theClass,
                                              org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: for inheritance purpose


getReferenceObjectKeys

public java.util.Vector getReferenceObjectKeys(ObjectLevelModifyQuery query)
                                        throws DatabaseException,
                                               OptimisticLockException
INTERNAL: get reference object keys

Throws:
DatabaseException
OptimisticLockException

getSourceKeyFieldNames

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


getSourceKeyFields

public java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> getSourceKeyFields()
INTERNAL: Return the source key names associated with the mapping


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.


getTargetForeignKeyFields

public java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> getTargetForeignKeyFields()
INTERNAL: Return the target foregin key fields associated with the mapping


getTargetForeignKeyToSourceKeys

public java.util.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 DescriptorException
INTERNAL: 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:
initialize in class CollectionMapping
Throws:
DescriptorException

initializeReferenceDescriptor

protected void initializeReferenceDescriptor(org.eclipse.persistence.internal.sessions.AbstractSession session)
                                      throws DescriptorException
Initialize and set the descriptor for the referenced class in this mapping.

Overrides:
initializeReferenceDescriptor in class ForeignReferenceMapping
Throws:
DescriptorException

translateTablesAndFields

protected static void translateTablesAndFields(ClassDescriptor descriptor,
                                               java.util.HashMap<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> fieldTranslation,
                                               java.util.HashMap<org.eclipse.persistence.internal.helper.DatabaseTable,org.eclipse.persistence.internal.helper.DatabaseTable> tableTranslation)
INTERNAL: Called in case fieldTranslation != null Sets new primary keys, tables, appends fieldTranslation to fieldMap so that all fields in mappings, inheritance etc. translated to the new ones.


updateNestedAggregateCollectionMappings

protected void updateNestedAggregateCollectionMappings(ClassDescriptor descriptor)
INTERNAL: Called in case nestedAggregateToSourceFieldNames != null Updates AggregateCollectionMappings of the reference descriptor.


translateFields

protected void translateFields(ClassDescriptor clonedDescriptor,
                               org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: If field names are different in the source and aggregate objects then the translation is done here. The aggregate field name is converted to source field name from the field name mappings stored.


initializeChildInheritance

public void initializeChildInheritance(ClassDescriptor parentDescriptor,
                                       org.eclipse.persistence.internal.sessions.AbstractSession session,
                                       java.util.HashMap<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> fieldTranslation,
                                       java.util.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

initializeDeleteAllQuery

protected void initializeDeleteAllQuery(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Initialize delete all query. This query is used to delete the collection of objects from the target table.


initializeParentInheritance

public void initializeParentInheritance(ClassDescriptor parentDescriptor,
                                        ClassDescriptor childDescriptor,
                                        org.eclipse.persistence.internal.sessions.AbstractSession session,
                                        java.util.HashMap<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> fieldTranslation,
                                        java.util.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

initializeSelectionCriteria

protected void initializeSelectionCriteria(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Selection criteria is created with target foreign keys and source keys. This criteria is then used to read records from the target table.


initializeTargetForeignKeyToSourceKeys

protected void initializeTargetForeignKeyToSourceKeys(org.eclipse.persistence.internal.sessions.AbstractSession session)
                                               throws DescriptorException
INTERNAL: The foreign keys and the primary key names are converted to DatabaseFields and stored.

Throws:
DescriptorException

initializeTargetForeignKeyToSourceKeysWithDefaults

protected void initializeTargetForeignKeyToSourceKeysWithDefaults(org.eclipse.persistence.internal.sessions.AbstractSession session)
                                                           throws DescriptorException
INTERNAL: The foreign keys and the primary key names are converted to DatabaseFields and stored. The source keys are not specified by the user so primary keys are extracted from the reference descriptor.

Throws:
DescriptorException

iterateOnElement

public void iterateOnElement(org.eclipse.persistence.internal.descriptors.DescriptorIterator iterator,
                             java.lang.Object element)
INTERNAL: Iterate on the specified element.

Overrides:
iterateOnElement in class CollectionMapping

isAggregateCollectionMapping

public boolean isAggregateCollectionMapping()
INTERNAL:

Overrides:
isAggregateCollectionMapping in class DatabaseMapping

isJoiningSupported

public boolean isJoiningSupported()
INTERNAL: Return if this mapping support joining.

Overrides:
isJoiningSupported in class ForeignReferenceMapping

isPrivateOwned

public boolean isPrivateOwned()
INTERNAL:

Overrides:
isPrivateOwned in class ForeignReferenceMapping

isSourceKeySpecified

protected boolean isSourceKeySpecified()
Checks if source key is specified or not.


mergeChangesIntoObject

public void mergeChangesIntoObject(java.lang.Object target,
                                   org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord,
                                   java.lang.Object source,
                                   org.eclipse.persistence.internal.sessions.MergeManager mergeManager)
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:
mergeChangesIntoObject in class CollectionMapping

mergeIntoObject

public void mergeIntoObject(java.lang.Object target,
                            boolean isTargetUnInitialized,
                            java.lang.Object source,
                            org.eclipse.persistence.internal.sessions.MergeManager mergeManager)
INTERNAL: Merge changes from the source to the target object.

Overrides:
mergeIntoObject in class CollectionMapping

objectAddedDuringUpdate

protected void objectAddedDuringUpdate(ObjectLevelModifyQuery query,
                                       java.lang.Object objectAdded,
                                       org.eclipse.persistence.internal.sessions.ObjectChangeSet changeSet)
                                throws DatabaseException,
                                       OptimisticLockException
INTERNAL: An object was added to the collection during an update, insert it if private.

Overrides:
objectAddedDuringUpdate in class CollectionMapping
Throws:
DatabaseException
OptimisticLockException

objectRemovedDuringUpdate

protected void objectRemovedDuringUpdate(ObjectLevelModifyQuery query,
                                         java.lang.Object objectDeleted)
                                  throws DatabaseException,
                                         OptimisticLockException
INTERNAL: An object was removed to the collection during an update, delete it if private.

Overrides:
objectRemovedDuringUpdate in class CollectionMapping
Throws:
DatabaseException
OptimisticLockException

objectUnchangedDuringUpdate

protected void objectUnchangedDuringUpdate(ObjectLevelModifyQuery query,
                                           java.lang.Object object,
                                           java.util.Hashtable backupCloneKeyedCache,
                                           org.eclipse.persistence.internal.identitymaps.CacheKey cachedKey)
                                    throws DatabaseException,
                                           OptimisticLockException
INTERNAL: An object is still in the collection, update it as it may have changed.

Overrides:
objectUnchangedDuringUpdate in class CollectionMapping
Throws:
DatabaseException
OptimisticLockException

postInitialize

public void postInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
                    throws DescriptorException
INTERNAL: 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:
postInitialize in class DatabaseMapping
Throws:
DescriptorException

postInsert

public void postInsert(WriteObjectQuery query)
                throws DatabaseException,
                       OptimisticLockException
INTERNAL: Insert privately owned parts

Overrides:
postInsert in class DatabaseMapping
Throws:
DatabaseException
OptimisticLockException

postUpdate

public void postUpdate(WriteObjectQuery writeQuery)
                throws DatabaseException,
                       OptimisticLockException
INTERNAL: Update the privately owned parts

Overrides:
postUpdate in class DatabaseMapping
Throws:
DatabaseException
OptimisticLockException

preDelete

public void preDelete(DeleteObjectQuery query)
               throws DatabaseException,
                      OptimisticLockException
INTERNAL: Delete privately owned parts

Overrides:
preDelete in class DatabaseMapping
Throws:
DatabaseException
OptimisticLockException

preInsert

public void preInsert(WriteObjectQuery query)
               throws DatabaseException,
                      OptimisticLockException
INTERNAL: The message is passed to its reference class descriptor.

Overrides:
preInsert in class DatabaseMapping
Throws:
DatabaseException
OptimisticLockException

getInsertObjectQuery

protected InsertObjectQuery getInsertObjectQuery(org.eclipse.persistence.internal.sessions.AbstractSession session,
                                                 ClassDescriptor desc)
INTERNAL: Returns clone of InsertObjectQuery from the reference descriptor, if it is not set - create it.


getAndPrepareModifyQueryForInsert

public InsertObjectQuery getAndPrepareModifyQueryForInsert(ObjectLevelModifyQuery originalQuery,
                                                           java.lang.Object object)
INTERNAL: setup the modifyQuery for post insert/update and pre delete


prepareModifyQueryForDelete

public void prepareModifyQueryForDelete(ObjectLevelModifyQuery originalQuery,
                                        ObjectLevelModifyQuery modifyQuery,
                                        java.lang.Object object)
INTERNAL: setup the modifyQuery for pre delete


prepareModifyQueryForUpdate

public void prepareModifyQueryForUpdate(ObjectLevelModifyQuery originalQuery,
                                        ObjectLevelModifyQuery modifyQuery,
                                        java.lang.Object object)
INTERNAL: setup the modifyQuery for update,


setReferenceDescriptor

protected void setReferenceDescriptor(ClassDescriptor aDescriptor)
INTERNAL: Set the referenceDescriptor. This is a descriptor which is associated with the reference class.

Overrides:
setReferenceDescriptor in class ForeignReferenceMapping

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.


setSourceKeyFields

public void setSourceKeyFields(java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> sourceKeyFields)
INTERNAL: set all the primary key names associated with this mapping


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.


setTargetForeignKeyFields

public void setTargetForeignKeyFields(java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> targetForeignKeyFields)
INTERNAL: set the target foregin key fields associated with the mapping


setTargetForeignKeyToSourceKeys

protected void setTargetForeignKeyToSourceKeys(java.util.Map<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> targetForeignKeyToSourceKeys)

shouldObjectModifyCascadeToParts

protected boolean shouldObjectModifyCascadeToParts(ObjectLevelModifyQuery query)
Returns true as any process leading to object modification should also affect its privately owned parts Usually used by write, insert, update and delete.

Overrides:
shouldObjectModifyCascadeToParts in class ForeignReferenceMapping

simpleAddToCollectionChangeRecord

public void simpleAddToCollectionChangeRecord(java.lang.Object referenceKey,
                                              java.lang.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:
simpleAddToCollectionChangeRecord in class CollectionMapping

simpleRemoveFromCollectionChangeRecord

public void simpleRemoveFromCollectionChangeRecord(java.lang.Object referenceKey,
                                                   java.lang.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:
simpleRemoveFromCollectionChangeRecord in class CollectionMapping

valueFromRow

public java.lang.Object valueFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row,
                                     org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager,
                                     ObjectBuildingQuery sourceQuery,
                                     org.eclipse.persistence.internal.sessions.AbstractSession executionSession)
                              throws DatabaseException
INTERNAL: Retrieves a value from the row for a particular query key

Overrides:
valueFromRow in class ForeignReferenceMapping
Throws:
DatabaseException

verifyDelete

public boolean verifyDelete(java.lang.Object object,
                            org.eclipse.persistence.internal.sessions.AbstractSession session)
                     throws DatabaseException
INTERNAL: Checks if object is deleted from the database or not.

Overrides:
verifyDelete in class CollectionMapping
Throws:
DatabaseException

verifyDeleteForUpdate

protected void verifyDeleteForUpdate(DeleteObjectQuery query)
                              throws DatabaseException,
                                     OptimisticLockException
Verifying deletes make sure that all the records privately owned by this mapping are actually removed. If such records are found than those are all read and removed one by one taking their privately owned parts into account.

Throws:
DatabaseException
OptimisticLockException

addToCollectionChangeRecord

public void addToCollectionChangeRecord(java.lang.Object newKey,
                                        java.lang.Object newValue,
                                        org.eclipse.persistence.internal.sessions.ObjectChangeSet objectChangeSet,
                                        org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)
                                 throws DescriptorException
INTERNAL: Add a new value and its change set to the collection change record. This is used by attribute change tracking. Currently it is not supported in AggregateCollectionMapping.

Overrides:
addToCollectionChangeRecord in class CollectionMapping
Throws:
DescriptorException

isCandidateForPrivateOwnedRemoval

public boolean isCandidateForPrivateOwnedRemoval()
INTERNAL: AggregateCollection contents should not be considered for addition to the UnitOfWork private owned objects list for removal.

Overrides:
isCandidateForPrivateOwnedRemoval in class DatabaseMapping

isCascadedLockingSupported

public boolean isCascadedLockingSupported()
INTERNAL Return true if this mapping supports cascaded version optimistic locking.

Overrides:
isCascadedLockingSupported in class DatabaseMapping

isChangeTrackingSupported

public boolean isChangeTrackingSupported(Project project)
INTERNAL: Return if this mapping supports change tracking.

Overrides:
isChangeTrackingSupported in class CollectionMapping

removeFromCollectionChangeRecord

public void removeFromCollectionChangeRecord(java.lang.Object newKey,
                                             java.lang.Object newValue,
                                             org.eclipse.persistence.internal.sessions.ObjectChangeSet objectChangeSet,
                                             org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)
                                      throws DescriptorException
INTERNAL: Remove a value and its change set from the collection change record. This is used by attribute change tracking. Currently it is not supported in AggregateCollectionMapping.

Overrides:
removeFromCollectionChangeRecord in class CollectionMapping
Throws:
DescriptorException

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:
remoteInitialization in class ForeignReferenceMapping

EclipseLink 1.1.4, build 'v20100812-r7860' API Reference