|
EclipseLink 1.1.1_ 1.1.1.v20090430-r4097 API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.persistence.mappings.DatabaseMapping
org.eclipse.persistence.mappings.AggregateMapping
public abstract class AggregateMapping
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.
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, descriptor, fields, isLazy, isOptional, isPrimaryKeyMapping, isReadOnly, isRemotelyInitialized, NO_FIELDS, NO_WEIGHT, properties, weight, WEIGHT_1 |
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,
java.lang.Object clone,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork)
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,
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 original,
java.lang.Object attributeValue,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork)
INTERNAL: Build and return a clone of the attribute. |
void |
buildCopy(java.lang.Object copy,
java.lang.Object original,
ObjectCopyingPolicy policy)
INTERNAL: Copy of the attribute of the object. |
protected java.lang.Object |
buildCopyOfAttributeValue(java.lang.Object attributeValue,
ObjectCopyingPolicy policy)
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)
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)
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. |
void |
postDelete(DeleteObjectQuery query)
INTERNAL: The message is passed to its reference class descriptor. |
protected 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. |
protected 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. |
protected 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. |
protected 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. |
protected 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. |
protected 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 java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.lang.Class referenceClass
protected java.lang.String referenceClassName
protected ClassDescriptor referenceDescriptor
Constructor Detail |
---|
public AggregateMapping()
Method Detail |
---|
protected DeleteObjectQuery buildAggregateDeleteQuery(DeleteObjectQuery sourceQuery, java.lang.Object sourceAttributeValue)
protected void buildAggregateModifyQuery(ObjectLevelModifyQuery sourceQuery, ObjectLevelModifyQuery aggregateQuery, java.lang.Object sourceAttributeValue)
protected WriteObjectQuery buildAggregateWriteQuery(WriteObjectQuery sourceQuery, java.lang.Object sourceAttributeValue)
public void buildBackupClone(java.lang.Object clone, java.lang.Object backup, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork)
buildBackupClone
in class DatabaseMapping
protected java.lang.Object buildBackupClonePart(java.lang.Object attributeValue, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork)
public void buildClone(java.lang.Object original, java.lang.Object clone, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork)
buildClone
in class DatabaseMapping
public void buildCloneFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, java.lang.Object clone, ObjectBuildingQuery sourceQuery, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork, org.eclipse.persistence.internal.sessions.AbstractSession executionSession)
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.
buildCloneFromRow
in class DatabaseMapping
protected java.lang.Object buildClonePart(java.lang.Object original, java.lang.Object attributeValue, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork)
public void buildCopy(java.lang.Object copy, java.lang.Object original, ObjectCopyingPolicy policy)
buildCopy
in class DatabaseMapping
protected java.lang.Object buildCopyOfAttributeValue(java.lang.Object attributeValue, ObjectCopyingPolicy policy)
public Expression buildExpression(java.lang.Object queryObject, QueryByExamplePolicy policy, Expression expressionBuilder, java.util.Map processedObjects, org.eclipse.persistence.internal.sessions.AbstractSession session)
buildExpression
in class DatabaseMapping
protected java.lang.Object buildNewMergeInstanceOf(java.lang.Object sourceAttributeValue, org.eclipse.persistence.internal.sessions.AbstractSession session)
protected boolean compareAttributeValues(java.lang.Object attributeValue1, java.lang.Object attributeValue2, org.eclipse.persistence.internal.sessions.AbstractSession session)
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)
compareForChange
in class DatabaseMapping
public boolean compareObjects(java.lang.Object firstObject, java.lang.Object secondObject, org.eclipse.persistence.internal.sessions.AbstractSession session)
compareObjects
in class DatabaseMapping
public void convertClassNamesToClasses(java.lang.ClassLoader classLoader)
convertClassNamesToClasses
in class DatabaseMapping
classLoader
- protected void executeEvent(int eventCode, ObjectLevelModifyQuery query)
protected void fixAttributeValue(java.lang.Object attributeValue, java.util.Map objectDescriptors, java.util.Map processedObjects, ObjectLevelReadQuery query, RemoteSession session)
public void fixObjectReferences(java.lang.Object object, java.util.Map objectDescriptors, java.util.Map processedObjects, ObjectLevelReadQuery query, RemoteSession session)
fixObjectReferences
in class DatabaseMapping
protected java.lang.Object getAttributeValueFromBackupClone(java.lang.Object backupClone)
protected org.eclipse.persistence.internal.descriptors.ObjectBuilder getObjectBuilderForClass(java.lang.Class javaClass, org.eclipse.persistence.internal.sessions.AbstractSession session)
protected org.eclipse.persistence.internal.descriptors.ObjectBuilder getObjectBuilder(java.lang.Object attributeValue, org.eclipse.persistence.internal.sessions.AbstractSession session)
protected DescriptorQueryManager getQueryManager(java.lang.Object attributeValue, org.eclipse.persistence.internal.sessions.AbstractSession session)
public java.lang.Class getReferenceClass()
public java.lang.String getReferenceClassName()
public ClassDescriptor getReferenceDescriptor()
getReferenceDescriptor
in class DatabaseMapping
protected ClassDescriptor getReferenceDescriptor(java.lang.Class theClass, org.eclipse.persistence.internal.sessions.AbstractSession session)
protected ClassDescriptor getReferenceDescriptor(java.lang.Object attributeValue, org.eclipse.persistence.internal.sessions.AbstractSession session)
public void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorException
initialize
in class DatabaseMapping
DescriptorException
public boolean isAggregateMapping()
isAggregateMapping
in class DatabaseMapping
public void iterate(org.eclipse.persistence.internal.descriptors.DescriptorIterator iterator)
iterate
in class DatabaseMapping
protected void iterateOnAttributeValue(org.eclipse.persistence.internal.descriptors.DescriptorIterator iterator, java.lang.Object attributeValue)
protected void mergeAttributeValue(java.lang.Object targetAttributeValue, boolean isTargetUnInitialized, java.lang.Object sourceAttributeValue, org.eclipse.persistence.internal.sessions.MergeManager mergeManager)
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)
mergeChangesIntoObject
in class DatabaseMapping
public void mergeIntoObject(java.lang.Object target, boolean isTargetUnInitialized, java.lang.Object source, org.eclipse.persistence.internal.sessions.MergeManager mergeManager)
mergeIntoObject
in class DatabaseMapping
public void postDelete(DeleteObjectQuery query) throws DatabaseException, OptimisticLockException
postDelete
in class DatabaseMapping
DatabaseException
OptimisticLockException
protected void postDeleteAttributeValue(DeleteObjectQuery query, java.lang.Object attributeValue) throws DatabaseException, OptimisticLockException
DatabaseException
OptimisticLockException
public void postInsert(WriteObjectQuery query) throws DatabaseException, OptimisticLockException
postInsert
in class DatabaseMapping
DatabaseException
OptimisticLockException
protected void postInsertAttributeValue(WriteObjectQuery query, java.lang.Object attributeValue) throws DatabaseException, OptimisticLockException
DatabaseException
OptimisticLockException
public void postUpdate(WriteObjectQuery query) throws DatabaseException, OptimisticLockException
postUpdate
in class DatabaseMapping
DatabaseException
OptimisticLockException
protected void postUpdateAttributeValue(WriteObjectQuery query, java.lang.Object attributeValue) throws DatabaseException, OptimisticLockException
DatabaseException
OptimisticLockException
public void preDelete(DeleteObjectQuery query) throws DatabaseException, OptimisticLockException
preDelete
in class DatabaseMapping
DatabaseException
OptimisticLockException
protected void preDeleteAttributeValue(DeleteObjectQuery query, java.lang.Object attributeValue) throws DatabaseException, OptimisticLockException
DatabaseException
OptimisticLockException
public void preInsert(WriteObjectQuery query) throws DatabaseException, OptimisticLockException
preInsert
in class DatabaseMapping
DatabaseException
OptimisticLockException
protected void preInsertAttributeValue(WriteObjectQuery query, java.lang.Object attributeValue) throws DatabaseException, OptimisticLockException
DatabaseException
OptimisticLockException
public void preUpdate(WriteObjectQuery query) throws DatabaseException, OptimisticLockException
preUpdate
in class DatabaseMapping
DatabaseException
OptimisticLockException
protected void preUpdateAttributeValue(WriteObjectQuery query, java.lang.Object attributeValue) throws DatabaseException, OptimisticLockException
DatabaseException
OptimisticLockException
public void remoteInitialization(DistributedSession session)
remoteInitialization
in class DatabaseMapping
public void setReferenceClass(java.lang.Class aClass)
public void setReferenceClassName(java.lang.String aClassName)
protected void setReferenceDescriptor(ClassDescriptor aDescriptor)
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
updateChangeRecord
in class DatabaseMapping
DescriptorException
public boolean verifyDelete(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractSession session) throws DatabaseException
verifyDelete
in class DatabaseMapping
DatabaseException
protected boolean verifyDeleteOfAttributeValue(java.lang.Object attributeValue, org.eclipse.persistence.internal.sessions.AbstractSession session) throws DatabaseException
DatabaseException
|
EclipseLink 1.1.1_ 1.1.1.v20090430-r4097 API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |