Top Description Fields Constructors Methods
org.eclipse.persistence.mappings.foundation

public abstract Class AbstractCompositeDirectCollectionMapping

extends DatabaseMapping
implements ContainerMapping, ArrayCollectionMapping
Class Inheritance
All Implemented Interfaces
org.eclipse.persistence.mappings.structures.ArrayCollectionMapping, org.eclipse.persistence.mappings.ContainerMapping
Known Direct Subclasses
org.eclipse.persistence.mappings.structures.ArrayMapping, org.eclipse.persistence.oxm.mappings.XMLCompositeDirectCollectionMapping, org.eclipse.persistence.oxm.mappings.XMLFragmentCollectionMapping, org.eclipse.persistence.eis.mappings.EISCompositeDirectCollectionMapping
Imports
java.util.*, org.eclipse.persistence.exceptions.*, org.eclipse.persistence.internal.descriptors.*, org.eclipse.persistence.internal.helper.*, org.eclipse.persistence.internal.identitymaps.CacheKey, org.eclipse.persistence.internal.oxm.mappings.Field, org.eclipse.persistence.internal.queries.*, org.eclipse.persistence.internal.sessions.*, org.eclipse.persistence.internal.sessions.remote.ObjectDescriptor, org.eclipse.persistence.mappings.*, org.eclipse.persistence.mappings.converters.*, org.eclipse.persistence.mappings.structures.ArrayCollectionMapping, .ArrayCollectionMappingHelper, org.eclipse.persistence.queries.*, org.eclipse.persistence.sessions.remote.*, org.eclipse.persistence.sessions.CopyGroup

AbstractCompositeDirectCollectionMapping consolidates the behavior of mappings that map collections of "native" data objects (e.g. Strings). These are objects that do not have their own descriptor and repeat within the XML record for the containing object.
Author
Big Country
Since
TOPLink/Java 3.0

Field Summary

Modifier and TypeField and Description
private ContainerPolicy
containerPolicy

This determines the type of container used to hold the nested collection in the object.

protected String
elementDataTypeName

This is the "data type" associated with each element in the nested collection.

protected DatabaseField
field

This is the field holding the nested collection.

protected Converter
valueConverter

Allows user defined conversion between the object value and the database value.

Inherited from org.eclipse.persistence.mappings.DatabaseMapping:
attributeAccessorattributeNamederivedIdMappingderivesIddescriptorfieldsisCacheableisInSopObjectisJPAIdisLazyisMapKeyMappingisOptionalisPrimaryKeyMappingisReadOnlyisRemotelyInitializedmapsIdValueNO_FIELDSNO_WEIGHTpropertiesunconvertedPropertiesweightWEIGHT_AGGREGATEWEIGHT_DIRECTWEIGHT_TO_ONEWEIGHT_TRANSFORM

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public Object
buildAddedElementFromChangeSet(Object changeSet, MergeManager mergeManager, AbstractSession targetSession)

Implements org.eclipse.persistence.mappings.structures.ArrayCollectionMapping.buildAddedElementFromChangeSet.

INTERNAL: Build and return a new element based on the change set.
public void
buildBackupClone(Object
TODO
clone
,
Object
TODO
backup
,
UnitOfWorkImpl
TODO
unitOfWork
)

Implements abstract org.eclipse.persistence.mappings.DatabaseMapping.buildBackupClone.

INTERNAL: Clone the attribute from the clone and assign it to the backup.
public Object
buildChangeSet(Object element, ObjectChangeSet owner, AbstractSession session)

Implements org.eclipse.persistence.mappings.structures.ArrayCollectionMapping.buildChangeSet.

INTERNAL: Build and return a change set for the specified element.
public void
buildClone(Object
TODO
original
,
CacheKey
TODO
cacheKey
,
Object
TODO
clone
,
Integer
TODO
refreshCascade
,
AbstractSession
TODO
cloningSession
)

Implements abstract org.eclipse.persistence.mappings.DatabaseMapping.buildClone.

INTERNAL: Clone the attribute from the original and assign it to the clone.
public void
buildCloneFromRow(AbstractRecord
TODO
row
,
JoinedAttributeManager
TODO
joinManager
,
Object
TODO
clone
,
CacheKey
TODO
sharedCacheKey
,
ObjectBuildingQuery
TODO
sourceQuery
,
UnitOfWorkImpl
TODO
unitOfWork
,
AbstractSession
TODO
executionSession
)

Implements abstract org.eclipse.persistence.mappings.DatabaseMapping.buildCloneFromRow.

INTERNAL: Extract value from the row and set the attribute to this value in the working copy clone.
protected Object
buildClonePart(Object attributeValue, CacheKey parentCacheKey, AbstractSession cloningSession)

Build and return a clone of the specified attribute value.

public void
buildCopy(Object
TODO
copy
,
Object
TODO
original
,
CopyGroup
TODO
group
)

Overrides org.eclipse.persistence.mappings.DatabaseMapping.buildCopy.

INTERNAL: Copy of the attribute of the object.
protected Object
buildElementFromChangeSet(Object changeSet, MergeManager mergeManager, AbstractSession targetSession)

Build and return a new element based on the change set.

public Object
buildElementFromElement(Object object, MergeManager mergeManager, AbstractSession targetSession)

Implements org.eclipse.persistence.mappings.structures.ArrayCollectionMapping.buildElementFromElement.

INTERNAL: Build and return a new element based on the specified element.
public Object
buildRemovedElementFromChangeSet(Object changeSet, MergeManager mergeManager, AbstractSession targetSession)

Implements org.eclipse.persistence.mappings.structures.ArrayCollectionMapping.buildRemovedElementFromChangeSet.

INTERNAL: Build and return a new element based on the change set.
public void
cascadePerformRemoveIfRequired(Object
TODO
object
,
UnitOfWorkImpl
TODO
uow
,
Map<K, V>
TODO
visitedObjects
)

Implements abstract org.eclipse.persistence.mappings.DatabaseMapping.cascadePerformRemoveIfRequired.

INTERNAL: Cascade perform delete through mappings that require the cascade
public void
cascadeRegisterNewIfRequired(Object
TODO
object
,
UnitOfWorkImpl
TODO
uow
,
Map<K, V>
TODO
visitedObjects
)

Implements abstract org.eclipse.persistence.mappings.DatabaseMapping.cascadeRegisterNewIfRequired.

INTERNAL: Cascade registerNew for Create through mappings that require the cascade
protected Vector<E>
collectFields()

Overrides org.eclipse.persistence.mappings.DatabaseMapping.collectFields.

Return the fields handled by the mapping.
public boolean
compareElements(Object element1, Object element2, AbstractSession session)

Implements org.eclipse.persistence.mappings.structures.ArrayCollectionMapping.compareElements.

INTERNAL: Compare the non-null elements.
public boolean
compareElementsForChange(Object element1, Object element2, AbstractSession session)

Implements org.eclipse.persistence.mappings.structures.ArrayCollectionMapping.compareElementsForChange.

INTERNAL: Compare the non-null elements and return true if they are alike.
public ChangeRecord
compareForChange(Object
TODO
clone
,
Object
TODO
backup
,
ObjectChangeSet
TODO
owner
,
AbstractSession
TODO
session
)

Implements abstract org.eclipse.persistence.mappings.DatabaseMapping.compareForChange.

INTERNAL: Build and return the change record that results from comparing the two direct collection attributes.
public boolean
compareObjects(Object
TODO
object1
,
Object
TODO
object2
,
AbstractSession
TODO
session
)

Implements abstract org.eclipse.persistence.mappings.DatabaseMapping.compareObjects.

INTERNAL: Compare the attributes belonging to this mapping for the objects.
public void
convertClassNamesToClasses(ClassLoader
TODO
classLoader
)

Overrides org.eclipse.persistence.mappings.DatabaseMapping.convertClassNamesToClasses.

INTERNAL: Convert all the class-name-based settings in this mapping to actual class-based settings This method is implemented by subclasses as necessary.
protected ChangeRecord
public Object
createMapComponentFromRow(AbstractRecord dbRow, ObjectBuildingQuery query, CacheKey parentCacheKey, AbstractSession session, boolean isTargetProtected)

INTERNAL Called when a DatabaseMapping is used to map the key in a collection.

public void
fixObjectReferences(Object
TODO
object
,
Map<Object, ObjectDescriptor>
TODO
objectDescriptors
,
Map<Object, Object>
TODO
processedObjects
,
ObjectLevelReadQuery
TODO
query
,
DistributedSession
TODO
session
)

Implements abstract org.eclipse.persistence.mappings.DatabaseMapping.fixObjectReferences.

INTERNAL: An object has been serialized from the server to the client.
public Class<?>
getAttributeElementClass()

PUBLIC: Return the class each element in the object's collection should be converted to, before the collection is inserted into the object.

public ContainerPolicy
public DatabaseField
getField()

Overrides org.eclipse.persistence.mappings.DatabaseMapping.getField.

INTERNAL: Return the field that holds the nested collection.
public Class<?>
getFieldClassification(DatabaseField fieldToClassify)

Overrides org.eclipse.persistence.mappings.DatabaseMapping.getFieldClassification.

INTERNAL: Return the classifiction for the field contained in the mapping.
public Class<?>
getFieldElementClass()

PUBLIC: Return the class each element in the database row's collection should be converted to, before the collection is inserted into the database.

public String
getFieldName()

PUBLIC: Return the name of the field that holds the nested collection.

public Object
public Converter
getValueConverter()

PUBLIC: Return the converter on the mapping.

public boolean
hasValueConverter()

PUBLIC: Indicates if there is a converter on the mapping.

public void
initialize(AbstractSession session)

Overrides org.eclipse.persistence.mappings.DatabaseMapping.initialize.

INTERNAL: Initialize the mapping.
public boolean
public boolean
isCollectionMapping()

Overrides org.eclipse.persistence.mappings.DatabaseMapping.isCollectionMapping.

INTERNAL: Related mapping should implement this method to return true.
public void
iterate(DescriptorIterator iterator)

Implements abstract org.eclipse.persistence.mappings.DatabaseMapping.iterate.

INTERNAL: Iterate on the appropriate attribute value.
public boolean
mapKeyHasChanged(Object element, AbstractSession session)

Implements org.eclipse.persistence.mappings.structures.ArrayCollectionMapping.mapKeyHasChanged.

INTERNAL: Return whether the element's user-defined Map key has changed since it was cloned from the original version.
public void
mergeChangesIntoObject(Object target, ChangeRecord changeRecord, Object source, MergeManager mergeManager, AbstractSession targetSession)

Implements abstract org.eclipse.persistence.mappings.DatabaseMapping.mergeChangesIntoObject.

INTERNAL: Merge changes from the source to the target object.
public void
mergeIntoObject(Object target, boolean isTargetUnInitialized, Object source, MergeManager mergeManager, AbstractSession targetSession)

Implements abstract org.eclipse.persistence.mappings.DatabaseMapping.mergeIntoObject.

INTERNAL: Merge changes from the source to the target object.
public void
setAttributeElementClass(Class<?> attributeElementClass)

PUBLIC: Set the class each element in the object's collection should be converted to, before the collection is inserted into the object.

public void
setAttributeElementClassName(String attributeElementClass)

PUBLIC: Set the class each element in the object's collection should be converted to, before the collection is inserted into the object.

public void
setContainerPolicy(ContainerPolicy containerPolicy)

Implements org.eclipse.persistence.mappings.ContainerMapping.setContainerPolicy.

ADVANCED: Set the mapping's containerPolicy.
public void
setField(DatabaseField field)

Set the field that holds the nested collection.

public void
setFieldElementClass(Class<?> fieldElementClass)

PUBLIC: Set the class each element in the database row's collection should be converted to, before the collection is inserted into the database.

public void
setUsesSingleNode(boolean
true if the items in the collection are in a single node or false if each of the items in the collection is in its own node
usesSingleNode
)

PUBLIC: Sets whether the mapping uses a single node.

public void
setValueConverter(Converter valueConverter)

PUBLIC: Set the converter on the mapping.

public void
simpleAddToCollectionChangeRecord(Object referenceKey, Object changeSetToAdd, ObjectChangeSet changeSet, AbstractSession session)

Overrides org.eclipse.persistence.mappings.DatabaseMapping.simpleAddToCollectionChangeRecord.

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.
public void
simpleRemoveFromCollectionChangeRecord(Object referenceKey, Object changeSetToRemove, ObjectChangeSet changeSet, AbstractSession session)

Overrides org.eclipse.persistence.mappings.DatabaseMapping.simpleRemoveFromCollectionChangeRecord.

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.
public void
useCollectionClass(Class<?> concreteClass)

Implements org.eclipse.persistence.mappings.ContainerMapping.useCollectionClass.

PUBLIC: Configure the mapping to use an instance of the specified container class to hold the nested objects.
public void
useCollectionClassName(String concreteClassName)

Implements org.eclipse.persistence.mappings.ContainerMapping.useCollectionClassName.

INTERNAL: Used to set the collection class by name.
public void
useListClassName(String concreteClassName)

Implements org.eclipse.persistence.mappings.ContainerMapping.useListClassName.

INTERNAL: Used to set the collection class by name.
public void
useMapClass(Class<?> concreteClass, String methodName)

Implements org.eclipse.persistence.mappings.ContainerMapping.useMapClass.

PUBLIC: Mapping does not support Map containers.
public void
useMapClassName(String concreteContainerClassName, String methodName)

Implements org.eclipse.persistence.mappings.ContainerMapping.useMapClassName.

PUBLIC: Configure the mapping to use an instance of the specified container class to hold the target objects.
public boolean

Returns:

True if the items in the collection are in a single node or false if each of the items in the collection is in its own node.
usesSingleNode
()

PUBLIC: Checks whether the mapping uses a single node.

public Object
valueFromRow(AbstractRecord row, JoinedAttributeManager joinManager, ObjectBuildingQuery sourceQuery, CacheKey cacheKey, AbstractSession executionSession, boolean isTargetProtected, Boolean[] wasCacheUsed)

Overrides org.eclipse.persistence.mappings.DatabaseMapping.valueFromRow.

INTERNAL: Build the nested collection from the database row.
public void
writeFromObjectIntoRow(Object object, AbstractRecord row, AbstractSession session, DatabaseMapping.WriteType writeType)

Overrides org.eclipse.persistence.mappings.DatabaseMapping.writeFromObjectIntoRow.

INTERNAL: Get the attribute value from the object and store it in the appropriate field of the row.
public void
writeFromObjectIntoRowForUpdate(WriteObjectQuery writeQuery, AbstractRecord row)

Overrides org.eclipse.persistence.mappings.DatabaseMapping.writeFromObjectIntoRowForUpdate.

INTERNAL: If any part of the nested collection has changed, the whole thing is written.
public void
writeFromObjectIntoRowWithChangeRecord(ChangeRecord changeRecord, AbstractRecord row, AbstractSession session, DatabaseMapping.WriteType writeType)

Overrides org.eclipse.persistence.mappings.DatabaseMapping.writeFromObjectIntoRowWithChangeRecord.

INTERNAL: Get the appropriate attribute value from the object and put it in the appropriate field of the database row.
public void
writeInsertFieldsIntoRow(AbstractRecord row, AbstractSession session)

Overrides org.eclipse.persistence.mappings.DatabaseMapping.writeInsertFieldsIntoRow.

INTERNAL: Write the fields needed for insert into the template with null values.
Inherited from org.eclipse.persistence.mappings.DatabaseMapping:
addUnconvertedPropertybuildBackupCloneForPartObjectbuildChangeRecordbuildCloneForPartObjectbuildContainerClonebuildExpressionbuildObjectJoinExpressionbuildObjectJoinExpressionbuildShallowOriginalFromRowcalculateDeferredChangescascadeDiscoverAndPersistUnregisteredNewObjectscascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequiredclonecloneFieldscollectQueryParametersconvertConverterClassNamesToClassescreateCloneValueHolderderivesIdearlyPreDeleteextractNestedExpressionsextractNestedNonAggregateExpressionsfixRealObjectReferencesgetAttributeAccessorgetAttributeClassificationgetAttributeNamegetAttributeValueFromObjectgetDerivedIdMappinggetDescriptorgetFieldsgetGetMethodNamegetMapsIdValuegetObjectCorrespondingTogetOrderByNormalizedExpressionsgetPropertiesgetPropertygetRealAttributeValueFromAttributegetRealAttributeValueFromObjectgetReferenceDescriptorgetRelationshipPartnergetSelectFieldsgetSelectTablesgetSetMethodNamegetUnconvertedPropertiesgetValueFromRemoteValueHoldergetWeighthasConstraintDependencyhasDependencyhasInverseConstraintDependencyhasMapsIdValuehasNestedIdentityReferencehasRootExpressionThatShouldUseOuterJoinhasUnconvertedPropertiesinstantiateAttributeisAbstractColumnMappingisAbstractCompositeCollectionMappingisAbstractCompositeObjectMappingisAbstractDirectMappingisAggregateCollectionMappingisAggregateMappingisAggregateObjectMappingisAttributeValueFromObjectInstantiatedisCacheableisCandidateForPrivateOwnedRemovalisCascadedLockingSupportedisChangeTrackingSupportedisCloningRequiredisDatabaseMappingisDirectCollectionMappingisDirectMapMappingisDirectToFieldMappingisDirectToXMLTypeMappingisEISMappingisElementCollectionMappingisForeignReferenceMappingisInAndOutSopObjectisInOnlySopObjectisInSopObjectisJoiningSupportedisJPAIdisLazyisLockableMappingisManyToManyMappingisManyToOneMappingisMapKeyMappingisMultitenantPrimaryKeyMappingisNestedTableMappingisObjectReferenceMappingisOneToManyMappingisOneToOneMappingisOptionalisOutOnlySopObjectisOutSopObjectisOwnedisPrimaryKeyMappingisPrivateOwnedisReadOnlyisReferenceMappingisRelationalMappingisRemotelyInitializedisStructureMappingisTransformationMappingisUnidirectionalOneToManyMappingisUsingMethodAccessisVariableOneToOneMappingisWriteOnlyisXMLMappingiterateOnRealAttributeValueloadloadAllperformDataModificationEventpostCalculateChangespostCalculateChangesOnDeletedpostDeletepostInitializepostInitializeSourceAndTargetExpressionspostInsertpostUpdatepreDeletepreInitializepreInsertprepareCascadeLockingPolicypreUpdatereadFromResultSetIntoObjectreadFromRowIntoObjectreadOnlyreadWriterecordPrivateOwnedRemovalsrehashFieldDependanciesremoteInitializationremotelyInitializedreplaceValueHoldersInsetAttributeAccessorsetAttributeNamesetAttributeValueInObjectsetChangeListenersetDerivedIdMappingsetDerivesIdsetDescriptorsetFieldssetGetMethodNamesetIsCacheablesetIsInAndOutSopObjectsetIsInSopObjectsetIsJPAIdsetIsLazysetIsMapKeyMappingsetIsOptionalsetIsOutSopObjectsetIsPrimaryKeyMappingsetIsReadOnlysetMapsIdValuesetPropertiessetPropertysetRealAttributeValueInObjectsetSetMethodNamesetWeighttoStringupdateChangeRecordupdateCollectionChangeRecordvalidateAfterInitializationvalidateBeforeInitializationvalueFromObjectvalueFromResultSetvalueFromRowverifyDeletewriteFromAttributeIntoRowwriteFromObjectIntoRowForShallowInsertwriteFromObjectIntoRowForShallowInsertWithChangeRecordwriteFromObjectIntoRowForUpdateAfterShallowInsertwriteFromObjectIntoRowForUpdateBeforeShallowDeletewriteFromObjectIntoRowForWhereClausewriteUpdateFieldsIntoRow