EclipseLink 2.2.0, build 'v20110202-r8913' API Reference

org.eclipse.persistence.mappings
Class AggregateMapping

java.lang.Object
  extended by org.eclipse.persistence.mappings.DatabaseMapping
      extended by org.eclipse.persistence.mappings.AggregateMapping
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
AbstractCompositeCollectionMapping, AbstractCompositeObjectMapping, AggregateObjectMapping, XMLInverseReferenceMapping, XMLObjectReferenceMapping

public abstract class AggregateMapping
extends DatabaseMapping

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

See Also:
Serialized Form
Author:
Sati
Since:
TopLink for Java 1.0

Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.persistence.mappings.DatabaseMapping
DatabaseMapping.WriteType
 
Field Summary
protected  java.lang.Class referenceClass
          Stores a reference class
protected  java.lang.String referenceClassName
           
protected  ClassDescriptor referenceDescriptor
          The descriptor of the reference class
 
Fields inherited from class org.eclipse.persistence.mappings.DatabaseMapping
attributeAccessor, attributeName, derivedIdMapping, derivesId, descriptor, fields, isCacheable, isJPAId, isLazy, isMapKeyMapping, isOptional, isPrimaryKeyMapping, isReadOnly, isRemotelyInitialized, mapsIdValue, NO_FIELDS, NO_WEIGHT, properties, weight, WEIGHT_AGGREGATE, WEIGHT_DIRECT, WEIGHT_TO_ONE, WEIGHT_TRANSFORM
 
Constructor Summary
AggregateMapping()
          Default constructor.
 
Method Summary
protected  DeleteObjectQuery buildAggregateDeleteQuery(DeleteObjectQuery sourceQuery, java.lang.Object sourceAttributeValue)
          Make a copy of the sourceQuery for the attribute.
protected  void buildAggregateModifyQuery(ObjectLevelModifyQuery sourceQuery, ObjectLevelModifyQuery aggregateQuery, java.lang.Object sourceAttributeValue)
          Initialize the aggregate query with the settings from the source query.
protected  WriteObjectQuery buildAggregateWriteQuery(WriteObjectQuery sourceQuery, java.lang.Object sourceAttributeValue)
          Make a copy of the sourceQuery for the attribute.
 void buildBackupClone(java.lang.Object clone, java.lang.Object backup, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork)
          INTERNAL: Clone the attribute from the clone and assign it to the backup.
protected  java.lang.Object buildBackupClonePart(java.lang.Object attributeValue, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork)
          INTERNAL: Build and return a backup clone of the attribute.
 void buildClone(java.lang.Object original, org.eclipse.persistence.internal.identitymaps.CacheKey cacheKey, java.lang.Object clone, org.eclipse.persistence.internal.sessions.AbstractSession cloningSession)
          INTERNAL: Clone the attribute from the original and assign it to the clone.
 void buildCloneFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, java.lang.Object clone, org.eclipse.persistence.internal.identitymaps.CacheKey sharedCacheKey, ObjectBuildingQuery sourceQuery, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork, org.eclipse.persistence.internal.sessions.AbstractSession executionSession)
          INTERNAL: A combination of readFromRowIntoObject and buildClone.
protected  java.lang.Object buildClonePart(java.lang.Object attributeValue, org.eclipse.persistence.internal.identitymaps.CacheKey parentCacheKey, org.eclipse.persistence.internal.sessions.AbstractSession cloningSession, boolean isNewObject)
          INTERNAL: * Build and return a clone of the attribute.
protected  java.lang.Object buildClonePart(java.lang.Object original, org.eclipse.persistence.internal.identitymaps.CacheKey cacheKey, java.lang.Object attributeValue, org.eclipse.persistence.internal.sessions.AbstractSession cloningSession)
          INTERNAL: Build and return a clone of the attribute.
 void buildCopy(java.lang.Object copy, java.lang.Object original, CopyGroup group)
          INTERNAL: Copy of the attribute of the object.
protected  java.lang.Object buildCopyOfAttributeValue(java.lang.Object attributeValue, CopyGroup group)
          Copy of the attribute of the object.
 Expression buildExpression(java.lang.Object queryObject, QueryByExamplePolicy policy, Expression expressionBuilder, java.util.Map processedObjects, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: In case Query By Example is used, this method generates an expression from a attribute value pair.
protected  java.lang.Object buildNewMergeInstanceOf(java.lang.Object sourceAttributeValue, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Build and return a new instance of the specified attribute.
protected  boolean compareAttributeValues(java.lang.Object attributeValue1, java.lang.Object attributeValue2, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Compare the attributes.
 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: Compare the changes between two aggregates.
 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.
 void convertClassNamesToClasses(java.lang.ClassLoader classLoader)
          INTERNAL: Convert all the class-name-based settings in this mapping to actual class-based settings.
protected  void executeEvent(int eventCode, ObjectLevelModifyQuery query)
          INTERNAL: Execute a descriptor event for the specified event code.
protected  void fixAttributeValue(java.lang.Object attributeValue, java.util.Map objectDescriptors, java.util.Map processedObjects, ObjectLevelReadQuery query, RemoteSession session)
          INTERNAL: An object has been serialized from the server to the remote client.
 void fixObjectReferences(java.lang.Object object, java.util.Map objectDescriptors, java.util.Map processedObjects, ObjectLevelReadQuery query, RemoteSession session)
          INTERNAL: An object has been serialized from the server to the remote client.
protected  java.lang.Object getAttributeValueFromBackupClone(java.lang.Object backupClone)
          Return the appropriate attribute value.
protected  org.eclipse.persistence.internal.descriptors.ObjectBuilder getObjectBuilder(java.lang.Object attributeValue, org.eclipse.persistence.internal.sessions.AbstractSession session)
          Convenience method
protected  org.eclipse.persistence.internal.descriptors.ObjectBuilder getObjectBuilderForClass(java.lang.Class javaClass, org.eclipse.persistence.internal.sessions.AbstractSession session)
          Convenience method
protected  DescriptorQueryManager getQueryManager(java.lang.Object attributeValue, org.eclipse.persistence.internal.sessions.AbstractSession session)
          Convenience method
 java.lang.Class getReferenceClass()
          PUBLIC: Returns the reference class
 java.lang.String getReferenceClassName()
          INTERNAL: Used by MW.
 ClassDescriptor getReferenceDescriptor()
          INTERNAL: Return the referenceDescriptor.
protected  ClassDescriptor getReferenceDescriptor(java.lang.Class theClass, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: For inheritance purposes.
protected  ClassDescriptor getReferenceDescriptor(java.lang.Object attributeValue, org.eclipse.persistence.internal.sessions.AbstractSession session)
          Convenience method
 void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Initialize the reference descriptor.
 boolean isAggregateMapping()
          INTERNAL: Related mapping should implement this method to return true.
 void iterate(org.eclipse.persistence.internal.descriptors.DescriptorIterator iterator)
          INTERNAL: Iterate on the appropriate attribute value.
protected  void iterateOnAttributeValue(org.eclipse.persistence.internal.descriptors.DescriptorIterator iterator, java.lang.Object attributeValue)
          Iterate on the specified attribute value.
protected  void mergeAttributeValue(java.lang.Object targetAttributeValue, boolean isTargetUnInitialized, java.lang.Object sourceAttributeValue, org.eclipse.persistence.internal.sessions.MergeManager mergeManager, org.eclipse.persistence.internal.sessions.AbstractSession targetSession)
          Merge the attribute values.
 void mergeChangesIntoObject(java.lang.Object target, org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord, java.lang.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.
 void mergeIntoObject(java.lang.Object target, boolean isTargetUnInitialized, java.lang.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.
 void postDelete(DeleteObjectQuery query)
          INTERNAL: The message is passed to its reference class descriptor.
 void postDeleteAttributeValue(DeleteObjectQuery query, java.lang.Object attributeValue)
          INTERNAL: The message is passed to its reference class descriptor.
 void postInsert(WriteObjectQuery query)
          INTERNAL: The message is passed to its reference class descriptor.
 void postInsertAttributeValue(WriteObjectQuery query, java.lang.Object attributeValue)
          INTERNAL: The message is passed to its reference class descriptor.
 void postUpdate(WriteObjectQuery query)
          INTERNAL: The message is passed to its reference class descriptor.
 void postUpdateAttributeValue(WriteObjectQuery query, java.lang.Object attributeValue)
          INTERNAL: The message is passed to its reference class descriptor.
 void preDelete(DeleteObjectQuery query)
          INTERNAL: The message is passed to its reference class descriptor.
 void preDeleteAttributeValue(DeleteObjectQuery query, java.lang.Object attributeValue)
          INTERNAL: The message is passed to its reference class descriptor.
 void preInsert(WriteObjectQuery query)
          INTERNAL: The message is passed to its reference class descriptor.
 void preInsertAttributeValue(WriteObjectQuery query, java.lang.Object attributeValue)
          INTERNAL: The message is passed to its reference class descriptor.
 void preUpdate(WriteObjectQuery query)
          INTERNAL: The message is passed to its reference class descriptor.
 void preUpdateAttributeValue(WriteObjectQuery query, java.lang.Object attributeValue)
          INTERNAL: The message is passed to its reference class descriptor.
 void remoteInitialization(DistributedSession session)
          INTERNAL: Once a descriptor is serialized to the remote session, all its mappings and reference descriptors are traversed.
 void setReferenceClass(java.lang.Class aClass)
          PUBLIC: This is a reference class whose instances this mapping will store in the domain objects.
 void setReferenceClassName(java.lang.String aClassName)
          INTERNAL: Used by MW.
protected  void setReferenceDescriptor(ClassDescriptor aDescriptor)
          INTERNAL: Set the referenceDescriptor.
 void updateChangeRecord(java.lang.Object sourceClone, java.lang.Object newValue, java.lang.Object oldValue, org.eclipse.persistence.internal.sessions.ObjectChangeSet objectChangeSet, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)
          INTERNAL: Either create a new change record or update the change record with the new value.
 boolean verifyDelete(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Return whether the specified object and all its components have been deleted.
protected  boolean verifyDeleteOfAttributeValue(java.lang.Object attributeValue, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Return whether the specified object and all its components have been deleted.
 
Methods inherited from class org.eclipse.persistence.mappings.DatabaseMapping
buildBackupCloneForPartObject, buildChangeRecord, buildCloneForPartObject, buildContainerClone, buildObjectJoinExpression, buildObjectJoinExpression, buildShallowOriginalFromRow, calculateDeferredChanges, cascadeDiscoverAndPersistUnregisteredNewObjects, cascadeMerge_, cascadePerformRemoveIfRequired, cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired, cascadeRegisterNewIfRequired, clone, cloneFields, collectFields, collectQueryParameters, createCloneValueHolder, derivesId, earlyPreDelete, extractNestedExpressions, fixRealObjectReferences, getAttributeAccessor, getAttributeClassification, getAttributeName, getAttributeValueFromObject, getContainerPolicy, getDerivedIdMapping, getDescriptor, getField, getFieldClassification, getFields, getGetMethodName, getMapsIdValue, getObjectCorrespondingTo, getProperties, getProperty, getRealAttributeValueFromAttribute, getRealAttributeValueFromObject, getRealCollectionAttributeValueFromObject, getRelationshipPartner, getSelectFields, getSelectTables, getSetMethodName, getValueFromRemoteValueHolder, getWeight, hasConstraintDependency, hasDependency, hasInverseConstraintDependency, hasMapsIdValue, hasRootExpressionThatShouldUseOuterJoin, instantiateAttribute, isAbstractCompositeCollectionMapping, isAbstractCompositeDirectCollectionMapping, isAbstractCompositeObjectMapping, isAbstractDirectMapping, isAggregateCollectionMapping, isAggregateObjectMapping, isCacheable, isCandidateForPrivateOwnedRemoval, isCascadedLockingSupported, isChangeTrackingSupported, isCloningRequired, isCollectionMapping, isDatabaseMapping, isDirectCollectionMapping, isDirectMapMapping, isDirectToFieldMapping, isDirectToXMLTypeMapping, isEISMapping, isForeignReferenceMapping, isJoiningSupported, isJPAId, isLazy, isLockableMapping, isManyToManyMapping, isManyToOneMapping, isMapKeyMapping, isNestedTableMapping, isObjectReferenceMapping, isOneToManyMapping, isOneToOneMapping, isOptional, isOwned, isPrimaryKeyMapping, isPrivateOwned, isReadOnly, isReferenceMapping, isRelationalMapping, isRemotelyInitialized, isStructureMapping, isTransformationMapping, isUnidirectionalOneToManyMapping, isUsingMethodAccess, isVariableOneToOneMapping, isWriteOnly, isXMLMapping, iterateOnRealAttributeValue, performDataModificationEvent, postCalculateChanges, postCalculateChangesOnDeleted, postInitialize, preInitialize, prepareCascadeLockingPolicy, readFromResultSetIntoObject, readFromRowIntoObject, readOnly, readWrite, recordPrivateOwnedRemovals, rehashFieldDependancies, remotelyInitialized, replaceValueHoldersIn, setAttributeAccessor, setAttributeName, setAttributeValueInObject, setChangeListener, setDerivedIdMapping, setDerivesId, setDescriptor, setFields, setGetMethodName, setIsCacheable, setIsJPAId, setIsLazy, setIsMapKeyMapping, setIsOptional, setIsPrimaryKeyMapping, setIsReadOnly, setMapsIdValue, setProperties, setProperty, setRealAttributeValueInObject, setSetMethodName, setWeight, simpleAddToCollectionChangeRecord, simpleRemoveFromCollectionChangeRecord, toString, updateCollectionChangeRecord, validateAfterInitialization, validateBeforeInitialization, valueFromObject, valueFromResultSet, valueFromRow, 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

referenceClass

protected java.lang.Class referenceClass
Stores a reference class


referenceClassName

protected java.lang.String referenceClassName

referenceDescriptor

protected ClassDescriptor referenceDescriptor
The descriptor of the reference class

Constructor Detail

AggregateMapping

public AggregateMapping()
Default constructor.

Method Detail

buildAggregateDeleteQuery

protected DeleteObjectQuery buildAggregateDeleteQuery(DeleteObjectQuery sourceQuery,
                                                      java.lang.Object sourceAttributeValue)
Make a copy of the sourceQuery for the attribute.


buildAggregateModifyQuery

protected void buildAggregateModifyQuery(ObjectLevelModifyQuery sourceQuery,
                                         ObjectLevelModifyQuery aggregateQuery,
                                         java.lang.Object sourceAttributeValue)
Initialize the aggregate query with the settings from the source query.


buildAggregateWriteQuery

protected WriteObjectQuery buildAggregateWriteQuery(WriteObjectQuery sourceQuery,
                                                    java.lang.Object sourceAttributeValue)
Make a copy of the sourceQuery for the attribute.


buildBackupClone

public void buildBackupClone(java.lang.Object clone,
                             java.lang.Object backup,
                             org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork)
INTERNAL: Clone the attribute from the clone and assign it to the backup.

Specified by:
buildBackupClone in class DatabaseMapping

buildBackupClonePart

protected java.lang.Object buildBackupClonePart(java.lang.Object attributeValue,
                                                org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork)
INTERNAL: Build and return a backup clone of the attribute.


buildClone

public void buildClone(java.lang.Object original,
                       org.eclipse.persistence.internal.identitymaps.CacheKey cacheKey,
                       java.lang.Object clone,
                       org.eclipse.persistence.internal.sessions.AbstractSession cloningSession)
INTERNAL: Clone the attribute from the original and assign it to the clone.

Specified by:
buildClone in class DatabaseMapping

buildCloneFromRow

public void buildCloneFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow,
                              org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager,
                              java.lang.Object clone,
                              org.eclipse.persistence.internal.identitymaps.CacheKey sharedCacheKey,
                              ObjectBuildingQuery sourceQuery,
                              org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork,
                              org.eclipse.persistence.internal.sessions.AbstractSession executionSession)
INTERNAL: A combination of readFromRowIntoObject and buildClone.

buildClone assumes the attribute value exists on the original and can simply be copied.

readFromRowIntoObject assumes that one is building an original.

Both of the above assumptions are false in this method, and actually attempts to do both at the same time.

Extract value from the row and set the attribute to this value in the working copy clone. In order to bypass the shared cache when in transaction a UnitOfWork must be able to populate working copies directly from the row.

Specified by:
buildCloneFromRow in class DatabaseMapping

buildClonePart

protected java.lang.Object buildClonePart(java.lang.Object original,
                                          org.eclipse.persistence.internal.identitymaps.CacheKey cacheKey,
                                          java.lang.Object attributeValue,
                                          org.eclipse.persistence.internal.sessions.AbstractSession cloningSession)
INTERNAL: Build and return a clone of the attribute.


buildClonePart

protected java.lang.Object buildClonePart(java.lang.Object attributeValue,
                                          org.eclipse.persistence.internal.identitymaps.CacheKey parentCacheKey,
                                          org.eclipse.persistence.internal.sessions.AbstractSession cloningSession,
                                          boolean isNewObject)
INTERNAL: * Build and return a clone of the attribute.


buildCopy

public void buildCopy(java.lang.Object copy,
                      java.lang.Object original,
                      CopyGroup group)
INTERNAL: Copy of the attribute of the object. This is NOT used for unit of work but for templatizing an object.

Overrides:
buildCopy in class DatabaseMapping

buildCopyOfAttributeValue

protected java.lang.Object buildCopyOfAttributeValue(java.lang.Object attributeValue,
                                                     CopyGroup group)
Copy of the attribute of the object. This is NOT used for unit of work but for templatizing an object.


buildExpression

public Expression buildExpression(java.lang.Object queryObject,
                                  QueryByExamplePolicy policy,
                                  Expression expressionBuilder,
                                  java.util.Map processedObjects,
                                  org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: In case Query By Example is used, this method generates an expression from a attribute value pair. Since this is an Aggregate mapping, a recursive call is made to the buildExpressionFromExample method of ObjectBuilder.

Overrides:
buildExpression in class DatabaseMapping

buildNewMergeInstanceOf

protected java.lang.Object buildNewMergeInstanceOf(java.lang.Object sourceAttributeValue,
                                                   org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Build and return a new instance of the specified attribute. This will be populated by a merge.


compareAttributeValues

protected boolean compareAttributeValues(java.lang.Object attributeValue1,
                                         java.lang.Object attributeValue2,
                                         org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Compare the attributes. Return true if they are alike.


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: Compare the changes between two aggregates. Return a change record holding the changes.

Specified by:
compareForChange in class DatabaseMapping
Returns:
prototype.changeset.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.

Specified by:
compareObjects in class DatabaseMapping

convertClassNamesToClasses

public void convertClassNamesToClasses(java.lang.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:
convertClassNamesToClasses in class DatabaseMapping
Parameters:
classLoader -

executeEvent

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


fixAttributeValue

protected void fixAttributeValue(java.lang.Object attributeValue,
                                 java.util.Map objectDescriptors,
                                 java.util.Map processedObjects,
                                 ObjectLevelReadQuery query,
                                 RemoteSession session)
INTERNAL: An object has been serialized from the server to the remote client. Replace the transient attributes of the remote value holders with client-side objects.


fixObjectReferences

public void fixObjectReferences(java.lang.Object object,
                                java.util.Map objectDescriptors,
                                java.util.Map processedObjects,
                                ObjectLevelReadQuery query,
                                RemoteSession session)
INTERNAL: An object has been serialized from the server to the remote client. Replace the transient attributes of the remote value holders with client-side objects.

Specified by:
fixObjectReferences in class DatabaseMapping

getAttributeValueFromBackupClone

protected java.lang.Object getAttributeValueFromBackupClone(java.lang.Object backupClone)
Return the appropriate attribute value. This method is a hack to allow the aggregate collection subclass to override....


getObjectBuilderForClass

protected org.eclipse.persistence.internal.descriptors.ObjectBuilder getObjectBuilderForClass(java.lang.Class javaClass,
                                                                                              org.eclipse.persistence.internal.sessions.AbstractSession session)
Convenience method


getObjectBuilder

protected org.eclipse.persistence.internal.descriptors.ObjectBuilder getObjectBuilder(java.lang.Object attributeValue,
                                                                                      org.eclipse.persistence.internal.sessions.AbstractSession session)
Convenience method


getQueryManager

protected DescriptorQueryManager getQueryManager(java.lang.Object attributeValue,
                                                 org.eclipse.persistence.internal.sessions.AbstractSession session)
Convenience method


getReferenceClass

public java.lang.Class getReferenceClass()
PUBLIC: Returns the reference class


getReferenceClassName

public java.lang.String getReferenceClassName()
INTERNAL: Used by MW.


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 DatabaseMapping

getReferenceDescriptor

protected ClassDescriptor getReferenceDescriptor(java.lang.Class theClass,
                                                 org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: For inheritance purposes.


getReferenceDescriptor

protected ClassDescriptor getReferenceDescriptor(java.lang.Object attributeValue,
                                                 org.eclipse.persistence.internal.sessions.AbstractSession session)
Convenience method


initialize

public void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
                throws DescriptorException
INTERNAL: Initialize the reference descriptor.

Overrides:
initialize in class DatabaseMapping
Throws:
DescriptorException

isAggregateMapping

public boolean isAggregateMapping()
INTERNAL: Related mapping should implement this method to return true.

Overrides:
isAggregateMapping in class DatabaseMapping

iterate

public void iterate(org.eclipse.persistence.internal.descriptors.DescriptorIterator iterator)
INTERNAL: Iterate on the appropriate attribute value.

Specified by:
iterate in class DatabaseMapping

iterateOnAttributeValue

protected void iterateOnAttributeValue(org.eclipse.persistence.internal.descriptors.DescriptorIterator iterator,
                                       java.lang.Object attributeValue)
Iterate on the specified attribute value.


mergeAttributeValue

protected void mergeAttributeValue(java.lang.Object targetAttributeValue,
                                   boolean isTargetUnInitialized,
                                   java.lang.Object sourceAttributeValue,
                                   org.eclipse.persistence.internal.sessions.MergeManager mergeManager,
                                   org.eclipse.persistence.internal.sessions.AbstractSession targetSession)
Merge the attribute values.


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,
                                   org.eclipse.persistence.internal.sessions.AbstractSession targetSession)
INTERNAL: Merge changes from the source to the target object. With aggregates the merge must cascade to the object changes for the aggregate object because aggregate objects have no identity outside of themselves. The actual aggregate object does not need to be replaced, because even if the clone references another aggregate it appears the same to TopLink

Specified by:
mergeChangesIntoObject in class DatabaseMapping

mergeIntoObject

public void mergeIntoObject(java.lang.Object target,
                            boolean isTargetUnInitialized,
                            java.lang.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. This merge is only called when a changeSet for the target does not exist or the target is uninitialized

Specified by:
mergeIntoObject in class DatabaseMapping

postDelete

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

Overrides:
postDelete in class DatabaseMapping
Throws:
DatabaseException
OptimisticLockException

postDeleteAttributeValue

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

Throws:
DatabaseException
OptimisticLockException

postInsert

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

Overrides:
postInsert in class DatabaseMapping
Throws:
DatabaseException
OptimisticLockException

postInsertAttributeValue

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

Throws:
DatabaseException
OptimisticLockException

postUpdate

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

Overrides:
postUpdate in class DatabaseMapping
Throws:
DatabaseException
OptimisticLockException

postUpdateAttributeValue

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

Throws:
DatabaseException
OptimisticLockException

preDelete

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

Overrides:
preDelete in class DatabaseMapping
Throws:
DatabaseException
OptimisticLockException

preDeleteAttributeValue

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

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

preInsertAttributeValue

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

Throws:
DatabaseException
OptimisticLockException

preUpdate

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

Overrides:
preUpdate in class DatabaseMapping
Throws:
DatabaseException
OptimisticLockException

preUpdateAttributeValue

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

Throws:
DatabaseException
OptimisticLockException

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 DatabaseMapping

setReferenceClass

public void setReferenceClass(java.lang.Class aClass)
PUBLIC: This is a reference class whose instances this mapping will store in the domain objects.


setReferenceClassName

public void setReferenceClassName(java.lang.String aClassName)
INTERNAL: Used by MW.


setReferenceDescriptor

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


updateChangeRecord

public void updateChangeRecord(java.lang.Object sourceClone,
                               java.lang.Object newValue,
                               java.lang.Object oldValue,
                               org.eclipse.persistence.internal.sessions.ObjectChangeSet objectChangeSet,
                               org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)
                        throws DescriptorException
INTERNAL: Either create a new change record or update the change record with the new value. This is used by attribute change tracking.

Overrides:
updateChangeRecord in class DatabaseMapping
Throws:
DescriptorException

verifyDelete

public boolean verifyDelete(java.lang.Object object,
                            org.eclipse.persistence.internal.sessions.AbstractSession session)
                     throws DatabaseException
INTERNAL: Return whether the specified object and all its components have been deleted.

Overrides:
verifyDelete in class DatabaseMapping
Throws:
DatabaseException

verifyDeleteOfAttributeValue

protected boolean verifyDeleteOfAttributeValue(java.lang.Object attributeValue,
                                               org.eclipse.persistence.internal.sessions.AbstractSession session)
                                        throws DatabaseException
INTERNAL: Return whether the specified object and all its components have been deleted.

Throws:
DatabaseException

EclipseLink 2.2.0, build 'v20110202-r8913' API Reference