EclipseLink 2.2.0, build 'v20110202-r8913' API Reference

org.eclipse.persistence.mappings.foundation
Class AbstractCompositeObjectMapping

java.lang.Object
  extended by org.eclipse.persistence.mappings.DatabaseMapping
      extended by org.eclipse.persistence.mappings.AggregateMapping
          extended by org.eclipse.persistence.mappings.foundation.AbstractCompositeObjectMapping
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
EISCompositeObjectMapping, StructureMapping, XMLCompositeObjectMapping

public abstract class AbstractCompositeObjectMapping
extends AggregateMapping

Chunks of data from non-relational data sources can have an embedded component objects. These can be mapped using this mapping. The format of the embedded data is determined by the reference descriptor.

See Also:
Serialized Form
Author:
Big Country
Since:
TOPLink/Java 3.0

Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.persistence.mappings.DatabaseMapping
DatabaseMapping.WriteType
 
Field Summary
protected  Converter converter
          Allows user defined conversion between the object attribute value and the database value.
protected  org.eclipse.persistence.internal.helper.DatabaseField field
          The aggregate object is stored in a single field.
 
Fields inherited from class org.eclipse.persistence.mappings.AggregateMapping
referenceClass, referenceClassName, referenceDescriptor
 
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
AbstractCompositeObjectMapping()
          Default constructor.
 
Method Summary
protected abstract  java.lang.Object buildCompositeObject(org.eclipse.persistence.internal.descriptors.ObjectBuilder objectBuilder, org.eclipse.persistence.internal.sessions.AbstractRecord nestedRow, ObjectBuildingQuery query, org.eclipse.persistence.internal.identitymaps.CacheKey parentCacheKey, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManger, org.eclipse.persistence.internal.sessions.AbstractSession targetSession)
           
protected abstract  java.lang.Object buildCompositeRow(java.lang.Object attributeValue, org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.sessions.AbstractRecord record, DatabaseMapping.WriteType writeType)
           
 void buildShallowOriginalFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row, java.lang.Object original, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, ObjectBuildingQuery sourceQuery, org.eclipse.persistence.internal.sessions.AbstractSession executionSession)
          INTERNAL: Builds a shallow original object.
 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 perform delete through mappings that require the cascade
 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
protected  java.util.Vector collectFields()
          Return the fields mapped by the mapping.
 void convertClassNamesToClasses(java.lang.ClassLoader classLoader)
          INTERNAL: Convert all the class-name-based settings in this mapping to actual class-based settings.
 java.lang.Object getAttributeValueFromObject(java.lang.Object object)
          INTERNAL: Return the value of an attribute which this mapping represents for an object.
 Converter getConverter()
          PUBLIC: Return the converter on the mapping.
 org.eclipse.persistence.internal.helper.DatabaseField getField()
          INTERNAL: The aggregate object is held in a single field.
 boolean hasConverter()
          PUBLIC: Indicates if there is a converter on the mapping.
 void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Initialize the mapping.
 boolean isAbstractCompositeObjectMapping()
          INTERNAL:
 void setAttributeValueInObject(java.lang.Object object, java.lang.Object value)
          INTERNAL: Set the value of the attribute mapped by this mapping.
 void setConverter(Converter converter)
          PUBLIC: Set the converter on the mapping.
 void setField(org.eclipse.persistence.internal.helper.DatabaseField field)
          The aggregate object is held in a single field.
 java.lang.Object valueFromObject(java.lang.Object object, org.eclipse.persistence.internal.helper.DatabaseField field, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Extract and return value of the field from the object
 java.lang.Object valueFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, ObjectBuildingQuery sourceQuery, org.eclipse.persistence.internal.identitymaps.CacheKey cacheKey, org.eclipse.persistence.internal.sessions.AbstractSession executionSession, boolean isTargetProtected)
          INTERNAL: Extract and return the aggregate object from the specified row.
 void writeFromObjectIntoRow(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractRecord record, org.eclipse.persistence.internal.sessions.AbstractSession session, DatabaseMapping.WriteType writeType)
          INTERNAL: Build the value for the database field and put it in the specified database row.
 void writeFromObjectIntoRowForUpdate(WriteObjectQuery query, org.eclipse.persistence.internal.sessions.AbstractRecord row)
          INTERNAL: If it has changed, build the value for the database field and put it in the specified database row.
 void writeFromObjectIntoRowWithChangeRecord(org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord, org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session, DatabaseMapping.WriteType writeType)
          INTERNAL: Get the attribute value from the object and add the appropriate values to the specified database row.
 void writeInsertFieldsIntoRow(org.eclipse.persistence.internal.sessions.AbstractRecord record, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Write fields needed for insert into the template for with null values.
 
Methods inherited from class org.eclipse.persistence.mappings.AggregateMapping
buildAggregateDeleteQuery, buildAggregateModifyQuery, buildAggregateWriteQuery, buildBackupClone, buildBackupClonePart, buildClone, buildCloneFromRow, buildClonePart, buildClonePart, buildCopy, buildCopyOfAttributeValue, buildExpression, buildNewMergeInstanceOf, compareAttributeValues, compareForChange, compareObjects, executeEvent, fixAttributeValue, fixObjectReferences, getAttributeValueFromBackupClone, getObjectBuilder, getObjectBuilderForClass, getQueryManager, getReferenceClass, getReferenceClassName, getReferenceDescriptor, getReferenceDescriptor, getReferenceDescriptor, isAggregateMapping, iterate, iterateOnAttributeValue, mergeAttributeValue, mergeChangesIntoObject, mergeIntoObject, postDelete, postDeleteAttributeValue, postInsert, postInsertAttributeValue, postUpdate, postUpdateAttributeValue, preDelete, preDeleteAttributeValue, preInsert, preInsertAttributeValue, preUpdate, preUpdateAttributeValue, remoteInitialization, setReferenceClass, setReferenceClassName, setReferenceDescriptor, updateChangeRecord, verifyDelete, verifyDeleteOfAttributeValue
 
Methods inherited from class org.eclipse.persistence.mappings.DatabaseMapping
buildBackupCloneForPartObject, buildChangeRecord, buildCloneForPartObject, buildContainerClone, buildObjectJoinExpression, buildObjectJoinExpression, calculateDeferredChanges, cascadeMerge_, cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired, clone, cloneFields, collectQueryParameters, createCloneValueHolder, derivesId, earlyPreDelete, extractNestedExpressions, fixRealObjectReferences, getAttributeAccessor, getAttributeClassification, getAttributeName, getContainerPolicy, getDerivedIdMapping, getDescriptor, getFieldClassification, getFields, getGetMethodName, getMapsIdValue, getObjectCorrespondingTo, getProperties, getProperty, getRealAttributeValueFromAttribute, getRealAttributeValueFromObject, getRealCollectionAttributeValueFromObject, getRelationshipPartner, getSelectFields, getSelectTables, getSetMethodName, getValueFromRemoteValueHolder, getWeight, hasConstraintDependency, hasDependency, hasInverseConstraintDependency, hasMapsIdValue, hasRootExpressionThatShouldUseOuterJoin, instantiateAttribute, isAbstractCompositeCollectionMapping, isAbstractCompositeDirectCollectionMapping, 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, 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, valueFromResultSet, valueFromRow, writeFromAttributeIntoRow, writeFromObjectIntoRowForShallowInsert, writeFromObjectIntoRowForShallowInsertWithChangeRecord, writeFromObjectIntoRowForWhereClause, writeUpdateFieldsIntoRow
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

field

protected org.eclipse.persistence.internal.helper.DatabaseField field
The aggregate object is stored in a single field.


converter

protected Converter converter
Allows user defined conversion between the object attribute value and the database value.

Constructor Detail

AbstractCompositeObjectMapping

public AbstractCompositeObjectMapping()
Default constructor.

Method Detail

cascadePerformRemoveIfRequired

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

Specified by:
cascadePerformRemoveIfRequired in class DatabaseMapping

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 DatabaseMapping

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

Specified by:
cascadeRegisterNewIfRequired in class DatabaseMapping

collectFields

protected java.util.Vector collectFields()
Return the fields mapped by the mapping.

Overrides:
collectFields in class DatabaseMapping

getAttributeValueFromObject

public java.lang.Object getAttributeValueFromObject(java.lang.Object object)
                                             throws DescriptorException
INTERNAL: Return the value of an attribute which this mapping represents for an object.

Overrides:
getAttributeValueFromObject in class DatabaseMapping
Throws:
DescriptorException

getConverter

public Converter getConverter()
PUBLIC: Return the converter on the mapping. A converter can be used to convert between the object's value and database value of the attribute.


getField

public org.eclipse.persistence.internal.helper.DatabaseField getField()
INTERNAL: The aggregate object is held in a single field.

Overrides:
getField in class DatabaseMapping

hasConverter

public boolean hasConverter()
PUBLIC: Indicates if there is a converter on the mapping.


isAbstractCompositeObjectMapping

public boolean isAbstractCompositeObjectMapping()
INTERNAL:

Overrides:
isAbstractCompositeObjectMapping in class DatabaseMapping

initialize

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

Overrides:
initialize in class AggregateMapping
Throws:
DescriptorException

setAttributeValueInObject

public void setAttributeValueInObject(java.lang.Object object,
                                      java.lang.Object value)
                               throws DescriptorException
INTERNAL: Set the value of the attribute mapped by this mapping.

Overrides:
setAttributeValueInObject in class DatabaseMapping
Throws:
DescriptorException

setConverter

public void setConverter(Converter converter)
PUBLIC: Set the converter on the mapping. A converter can be used to convert between the object's value and database value of the attribute.


setField

public void setField(org.eclipse.persistence.internal.helper.DatabaseField field)
The aggregate object is held in a single field.


valueFromObject

public java.lang.Object valueFromObject(java.lang.Object object,
                                        org.eclipse.persistence.internal.helper.DatabaseField field,
                                        org.eclipse.persistence.internal.sessions.AbstractSession session)
                                 throws DescriptorException
INTERNAL: Extract and return value of the field from the object

Overrides:
valueFromObject in class DatabaseMapping
Throws:
DescriptorException

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.identitymaps.CacheKey cacheKey,
                                     org.eclipse.persistence.internal.sessions.AbstractSession executionSession,
                                     boolean isTargetProtected)
                              throws DatabaseException
INTERNAL: Extract and return the aggregate object from the specified row.

Overrides:
valueFromRow in class DatabaseMapping
Throws:
DatabaseException

buildShallowOriginalFromRow

public void buildShallowOriginalFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row,
                                        java.lang.Object original,
                                        org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager,
                                        ObjectBuildingQuery sourceQuery,
                                        org.eclipse.persistence.internal.sessions.AbstractSession executionSession)
INTERNAL: Builds a shallow original object. Only direct attributes and primary keys are populated. In this way the minimum original required for instantiating a working copy clone can be built without placing it in the shared cache (no concern over cycles).

Overrides:
buildShallowOriginalFromRow in class DatabaseMapping

buildCompositeObject

protected abstract java.lang.Object buildCompositeObject(org.eclipse.persistence.internal.descriptors.ObjectBuilder objectBuilder,
                                                         org.eclipse.persistence.internal.sessions.AbstractRecord nestedRow,
                                                         ObjectBuildingQuery query,
                                                         org.eclipse.persistence.internal.identitymaps.CacheKey parentCacheKey,
                                                         org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManger,
                                                         org.eclipse.persistence.internal.sessions.AbstractSession targetSession)

writeFromObjectIntoRow

public void writeFromObjectIntoRow(java.lang.Object object,
                                   org.eclipse.persistence.internal.sessions.AbstractRecord record,
                                   org.eclipse.persistence.internal.sessions.AbstractSession session,
                                   DatabaseMapping.WriteType writeType)
                            throws DescriptorException
INTERNAL: Build the value for the database field and put it in the specified database row.

Overrides:
writeFromObjectIntoRow in class DatabaseMapping
Throws:
DescriptorException

buildCompositeRow

protected abstract java.lang.Object buildCompositeRow(java.lang.Object attributeValue,
                                                      org.eclipse.persistence.internal.sessions.AbstractSession session,
                                                      org.eclipse.persistence.internal.sessions.AbstractRecord record,
                                                      DatabaseMapping.WriteType writeType)

writeFromObjectIntoRowForUpdate

public void writeFromObjectIntoRowForUpdate(WriteObjectQuery query,
                                            org.eclipse.persistence.internal.sessions.AbstractRecord row)
                                     throws DescriptorException
INTERNAL: If it has changed, build the value for the database field and put it in the specified database row. If any part of the aggregate object has changed, the entire object is written to the database row (i.e. partial updates are not supported).

Overrides:
writeFromObjectIntoRowForUpdate in class DatabaseMapping
Throws:
DescriptorException

writeFromObjectIntoRowWithChangeRecord

public void writeFromObjectIntoRowWithChangeRecord(org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord,
                                                   org.eclipse.persistence.internal.sessions.AbstractRecord row,
                                                   org.eclipse.persistence.internal.sessions.AbstractSession session,
                                                   DatabaseMapping.WriteType writeType)
                                            throws DescriptorException
INTERNAL: Get the attribute value from the object and add the appropriate values to the specified database row.

Overrides:
writeFromObjectIntoRowWithChangeRecord in class DatabaseMapping
Throws:
DescriptorException

writeInsertFieldsIntoRow

public void writeInsertFieldsIntoRow(org.eclipse.persistence.internal.sessions.AbstractRecord record,
                                     org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Write fields needed for insert into the template for with null values.

Overrides:
writeInsertFieldsIntoRow 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 AggregateMapping
Parameters:
classLoader -

EclipseLink 2.2.0, build 'v20110202-r8913' API Reference