java.lang.Object
org.eclipse.persistence.core.mappings.CoreMapping<AttributeAccessor,AbstractSession,ContainerPolicy,ClassDescriptor,DatabaseField>
org.eclipse.persistence.mappings.DatabaseMapping
org.eclipse.persistence.mappings.ForeignReferenceMapping
org.eclipse.persistence.mappings.CollectionMapping
org.eclipse.persistence.mappings.DirectCollectionMapping
org.eclipse.persistence.mappings.DirectMapMapping
- All Implemented Interfaces:
Serializable
,Cloneable
,ContainerMapping
,MapComponentMapping
,RelationalMapping
Mapping for a collection of key-value pairs.
The key and value must be simple types (String, Number, Date, etc.)
and stored in a single table along with a foreign key to the source object.
A converter can be used on the key and value if the desired object types
do not match the data types.
- Since:
- TopLink 3.5
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.persistence.mappings.DatabaseMapping
DatabaseMapping.WriteType
-
Field Summary
Fields inherited from class org.eclipse.persistence.mappings.DirectCollectionMapping
attributeClassification, attributeClassificationName, changeSetDeleteNullQuery, changeSetDeleteQuery, Delete, DeleteAll, DeleteAtIndex, deleteAtIndexQuery, directField, hasCustomDeleteAtIndexQuery, hasCustomDeleteQuery, hasCustomInsertQuery, hasCustomUpdateAtIndexQuery, historyPolicy, Insert, insertQuery, orderByExpressions, referenceKeyFields, referenceTable, sourceKeyFields, UpdateAtIndex, updateAtIndexQuery, valueConverter, valueConverterClassName
Fields inherited from class org.eclipse.persistence.mappings.CollectionMapping
changeOrderTargetQuery, containerPolicy, deleteAllQuery, hasCustomDeleteAllQuery, hasOrderBy, isListOrderFieldSupported, isSynchronizeOnMerge, listOrderField, mustDeleteReferenceObjectsOneByOne, orderCorrectionType
Fields inherited from class org.eclipse.persistence.mappings.ForeignReferenceMapping
batchFetchType, cascadeDetach, cascadeMerge, cascadePersist, cascadeRefresh, cascadeRemove, forceInitializationOfSelectionCriteria, hasCustomSelectionQuery, indirectionPolicy, INNER_JOIN, isCascadeOnDeleteSetOnDatabase, isPrivateOwned, joinFetch, mappedBy, NONE, OUTER_JOIN, partitioningPolicy, partitioningPolicyName, QUERY_BATCH_PARAMETER, referenceClass, referenceClassName, referenceDescriptor, relationshipPartner, relationshipPartnerAttributeName, requiresTransientWeavedFields, selectionQuery, tempInitSession
Fields inherited from class org.eclipse.persistence.mappings.DatabaseMapping
attributeAccessor, attributeName, derivedIdMapping, derivesId, descriptor, fields, isCacheable, isInSopObject, isJPAId, isLazy, isMapKeyMapping, isOptional, isPrimaryKeyMapping, isReadOnly, isRemotelyInitialized, mapsIdValue, NO_FIELDS, NO_WEIGHT, properties, unconvertedProperties, weight, WEIGHT_AGGREGATE, WEIGHT_DIRECT, WEIGHT_TO_ONE, WEIGHT_TRANSFORM
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addToCollectionChangeRecord
(Object newKey, Object newValue, ObjectChangeSet objectChangeSet, UnitOfWorkImpl uow) INTERNAL: Add a new value and its change set to the collection change record.buildCloneForPartObject
(Object attributeValue, Object original, CacheKey cacheKey, Object clone, AbstractSession cloningSession, Integer refreshCascade, boolean isExisting, boolean isFromSharedCache) INTERNAL: Require for cloning, the part must be cloned.void
calculateDeferredChanges
(ChangeRecord changeRecord, AbstractSession session) INTERNAL: Used by AttributeLevelChangeTracking to update a changeRecord with calculated changes as opposed to detected changes.void
cascadeDiscoverAndPersistUnregisteredNewObjects
(Object object, Map newObjects, Map unregisteredExistingObjects, Map visitedObjects, UnitOfWorkImpl uow, Set cascadeErrors) INTERNAL: Cascade discover and persist new objects during commit.void
cascadePerformRemoveIfRequired
(Object object, UnitOfWorkImpl uow, Map visitedObjects) INTERNAL: Cascade perform delete through mappings that require the cascadevoid
cascadeRegisterNewIfRequired
(Object object, UnitOfWorkImpl uow, Map visitedObjects) INTERNAL: Cascade registerNew for Create through mappings that require the cascadevoid
compareCollectionsForChange
(Object oldCollection, Object newCollection, ChangeRecord changeRecord, AbstractSession session) INTERNAL: This method is used to calculate the differences between two collections.compareForChange
(Object clone, Object backUp, ObjectChangeSet owner, AbstractSession session) INTERNAL: This method compares the changes between two direct collections.boolean
compareObjects
(Object firstObject, Object secondObject, AbstractSession session) INTERNAL: Compare the attributes belonging to this mapping for the objects.void
convertClassNamesToClasses
(ClassLoader classLoader) INTERNAL: Convert all the class-name-based settings in this mapping to actual class-based settings This method is implemented by subclasses as necessary.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.protected void
executeBatchQuery
(DatabaseQuery query, CacheKey parentCacheKey, Map referenceDataByKey, AbstractSession session, AbstractRecord translationRow) INTERNAL: Prepare and execute the batch query and store the results for each source object in a map keyed by the mappings source keys of the source objects.INTERNAL:Class
<?> PUBLIC: This is a helper method to get the object class from the key converter if it is a TypeConversionConverter.PUBLIC: Return the converter on the mapping.Class
<?> PUBLIC: This is a helper method to get the object class from the value converter if it is a TypeConversionConverter.void
initialize
(AbstractSession session) INTERNAL: Initialize and validate the mapping properties.protected void
initializeDeleteQuery
(AbstractSession session) protected void
initializeInsertQuery
(AbstractSession session) Initialize insert query.protected void
protected void
INTERNAL: Rebuild select query.boolean
INTERNAL: Related mapping should implement this method to return true.void
iterateOnElement
(DescriptorIterator iterator, Object element) INTERNAL: Iterate on the specified element.void
iterateOnRealAttributeValue
(DescriptorIterator iterator, Object realAttributeValue) INTERNAL: Iterate on the attribute value.void
mergeChangesIntoObject
(Object target, ChangeRecord changeRecord, Object source, MergeManager mergeManager, AbstractSession targetSession) INTERNAL: Merge changes from the source to the target object.void
mergeIntoObject
(Object target, boolean isTargetUnInitialized, Object source, MergeManager mergeManager, AbstractSession targetSession) INTERNAL: Merge changes from the source to the target object.void
performDataModificationEvent
(Object[] event, AbstractSession session) INTERNAL: Perform the commit event.void
postCalculateChanges
(ChangeRecord changeRecord, UnitOfWorkImpl uow) INTERNAL: Overridden by mappings that require additional processing of the change record after the record has been calculated.void
postInsert
(WriteObjectQuery query) INTERNAL: Insert the private owned object.protected void
postUpdateWithChangeSet
(WriteObjectQuery writeQuery) INTERNAL: Update private owned part.void
preDelete
(DeleteObjectQuery query) INTERNAL: Propagate the preDelete event through the container policy if necessaryvoid
recordPrivateOwnedRemovals
(Object object, UnitOfWorkImpl uow) INTERNAL: Overridden by mappings that require additional processing of the change record after the record has been calculated.protected void
removeFromCollectionChangeRecord
(Object newKey, Object newValue, ObjectChangeSet objectChangeSet, UnitOfWorkImpl uow) INTERNAL: Remove a value and its change set from the collection change record.void
setContainerPolicy
(ContainerPolicy containerPolicy) ADVANCED: Configure the mapping to use a container policy.void
setDirectKeyField
(DatabaseField keyField) INTERNAL:void
setDirectKeyFieldClassification
(Class<?> fieldType) ADVANCED: Set the class type of the field value.void
setDirectKeyFieldClassificationName
(String fieldTypeName) ADVANCED: Set the class type name of the field value.void
setDirectKeyFieldName
(String fieldName) PUBLIC: Set the direct key field name in the reference table.void
setKeyClass
(Class<?> keyClass) PUBLIC: This is a helper method to set the key converter to a TypeConversionConverter.void
setKeyConverter
(Converter keyConverter) PUBLIC: Set the converter on the mapping.void
setKeyConverterClassName
(String keyConverterClassName) INTERNAL: Set the converter class name on the mapping.void
setValueClass
(Class<?> valueClass) PUBLIC: This is a helper method to set the value converter to a TypeConversionConverter.void
simpleAddToCollectionChangeRecord
(Object referenceKey, Object objectToAdd, ObjectChangeSet changeSet, AbstractSession session) ADVANCED: This method is used to have an object add to a collection once the changeSet is applied The referenceKey parameter should only be used for direct Maps.void
simpleRemoveFromCollectionChangeRecord
(Object referenceKey, Object objectToRemove, ObjectChangeSet changeSet, AbstractSession session) ADVANCED: This method is used to have an object removed from a collection once the changeSet is applied The referenceKey parameter should only be used for direct Maps.void
updateChangeRecord
(Object clone, Object newValue, Object oldValue, ObjectChangeSet objectChangeSet, UnitOfWorkImpl uow) INTERNAL: Either create a new change record or update the change record with the new value.void
updateCollectionChangeRecord
(CollectionChangeEvent event, ObjectChangeSet changeSet, UnitOfWorkImpl uow) INTERNAL: Add or removes a new value and its change set to the collection change record based on the event passed in.void
useMapClass
(Class<?> concreteClass) PUBLIC: Configure the mapping to use an instance of the specified container class to hold the target objects.void
PUBLIC: Configure the mapping to use an instance of the specified container class to hold the target objects.protected Object
valueFromRowInternalWithJoin
(AbstractRecord row, JoinedAttributeManager joinManager, ObjectBuildingQuery sourceQuery, CacheKey parentCacheKey, AbstractSession executionSession, boolean isTargetProtected) INTERNAL: Return the value of the field from the row or a value holder on the query to obtain the object.Methods inherited from class org.eclipse.persistence.mappings.DirectCollectionMapping
addAscendingOrdering, addDescendingOrdering, addOrdering, addReferenceKeyField, addReferenceKeyFieldName, buildBatchCriteria, buildCopy, buildElementClone, buildExpression, buildListOrderField, cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired, clone, collectQueryParameters, compareLists, compareListsForChange, createWhereClauseForDeleteNullQuery, createWhereClauseForDeleteQuery, extractBatchKeyFromRow, extractKeyFromTargetRow, fixRealObjectReferences, getAdditionalFieldsBaseExpression, getAttributeClassification, getAttributeClassificationName, getDeleteAtIndexQuery, getDeleteNullQuery, getDeleteQuery, getDirectField, getDirectFieldName, getFieldsForTranslationInAggregate, getFieldValue, getHistoryPolicy, getInsertQuery, getJoinCriteria, getObjectCorrespondingTo, getObjectValue, getOrderByExpressions, getOrderByNormalizedExpressions, getReferenceClass, getReferenceClassName, getReferenceDescriptor, getReferenceKeyFieldNames, getReferenceKeyFields, getReferenceTable, getReferenceTableName, getReferenceTableQualifiedName, getRelationshipPartner, getSelectFields, getSelectionQueryContainerPolicy, getSelectTables, getSourceKeyFieldNames, getSourceKeyFields, getUpdateAtIndexQuery, getValueConverter, hasCustomDeleteAtIndexQuery, hasCustomDeleteQuery, hasCustomInsertQuery, hasCustomUpdateAtIndexQuery, hasNestedIdentityReference, initializeDeleteAllQuery, initializeDeleteAtIndexQuery, initializeDeleteNullQuery, initializeDirectField, initializeListOrderField, initializeReferenceDescriptor, initializeReferenceKeys, initializeReferenceTable, initializeSelectionCriteria, initializeSelectionQuery, initializeSourceKeys, initializeSourceKeysWithDefaults, initializeUpdateAtIndexQuery, isCandidateForPrivateOwnedRemoval, isCascadedLockingSupported, isDirectCollectionMapping, isElementCollectionMapping, isJoiningSupported, isKeyForSourceSpecified, isLockableMapping, isOwned, isRelationalMapping, mergeAddRemoveChanges, postUpdate, postUpdateWithChangeSetListOrder, prepareNestedBatchQuery, prepareNestedJoins, prepareTranslationRow, remoteInitialization, replaceValueHoldersIn, setAttributeClassification, setAttributeClassificationName, setCustomDeleteAtIndexQuery, setCustomDeleteQuery, setCustomInsertQuery, setCustomUpdateAtIndexQuery, setDeleteQuery, setDeleteSQLString, setDirectField, setDirectFieldClassification, setDirectFieldClassificationName, setDirectFieldName, setHasCustomDeleteQuery, setHasCustomInsertQuery, setHistoryPolicy, setInsertQuery, setInsertSQLString, setReferenceClass, setReferenceClassName, setReferenceKeyFieldName, setReferenceKeyFieldNames, setReferenceKeyFields, setReferenceTable, setReferenceTableName, setSelectionCriteria, setSelectionQueryContainerPolicy, setSessionName, setSourceKeyFieldNames, setSourceKeyFields, setValueConverter, setValueConverterClassName, shouldUseListOrderFieldTableExpression, simpleAddToCollectionChangeRecord, simpleRemoveFromCollectionChangeRecord, useMapClass, valueFromRow, verifyDelete
Methods inherited from class org.eclipse.persistence.mappings.CollectionMapping
addAggregateOrderBy, addAscendingOrdering, addDescendingOrdering, addOrderBy, buildBackupCloneForPartObject, buildChangeRecord, buildContainerClone, buildElementUnitOfWorkClone, buildReferencesPKList, compareLists, compareListsAndWrite, compareObjectsAndWrite, compareObjectsWithoutPrivateOwned, compareObjectsWithPrivateOwned, copyElement, extractResultFromBatchQuery, getContainerPolicy, getDeleteAllQuery, getListOrderField, getOrderByQueryKeyExpressions, getOrderCorrectionType, getRealCollectionAttributeValueFromObject, getTargetPrimaryKeyFields, hasCustomDeleteAllQuery, hasOrderBy, initializeChangeOrderTargetQuery, initializeListOrderFieldTable, isAttributeValueInstantiatedOrChanged, isChangeTrackingSupported, isCollectionMapping, isListOrderFieldSupported, isMapKeyObjectRelationship, load, loadAll, mustDeleteReferenceObjectsOneByOne, objectAddedDuringUpdate, objectOrderChangedDuringUpdate, objectRemovedDuringUpdate, objectUnchangedDuringUpdate, objectUnchangedDuringUpdate, postDelete, postInitialize, postPrepareNestedBatchQuery, preInsert, preUpdate, readPrivateOwnedForObject, setChangeListener, setCustomDeleteAllQuery, setDeleteAllCall, setDeleteAllQuery, setDeleteAllSQLString, setHasCustomDeleteAllQuery, setListOrderField, setListOrderFieldName, setMustDeleteReferenceObjectsOneByOne, setOrderCorrectionType, setUseLazyInstantiationForIndirectCollection, shouldUseLazyInstantiationForIndirectCollection, updateChangeRecordForSelfMerge, useCollectionClass, useCollectionClassName, useListClassName, useMapClassName, useSortedSetClass, useSortedSetClassName, useSortedSetClassName, useTransparentCollection, useTransparentList, useTransparentMap, useTransparentSet, validateBeforeInitialization, valueFromPKList, writeChanges
Methods inherited from class org.eclipse.persistence.mappings.ForeignReferenceMapping
addForeignKeyField, addTargetForeignKeyField, batchedValueFromRow, buildBackupClone, buildClone, buildCloneFromRow, checkCacheForBatchKey, createCloneValueHolder, dontDoMerge, dontUseBatchReading, dontUseIndirection, extendPessimisticLockScopeInSourceQuery, extendPessimisticLockScopeInTargetQuery, fixObjectReferences, getAttributeValueFromObject, getAttributeValueWithClonedValueHolders, getBatchFetchType, getExtendPessimisticLockScopeDedicatedQuery, getIndirectionPolicy, getJoinFetch, getMappedBy, getPartitioningPolicy, getPartitioningPolicyName, getRealAttributeValueFromAttribute, getRelationshipPartnerAttributeName, getSelectionCriteria, getSelectionQuery, getTempSession, getValueFromRemoteValueHolder, hasCustomSelectionQuery, hasDependency, instantiateAttribute, isAttributeValueFromObjectInstantiated, isAttributeValueFullyBuilt, isAttributeValueInstantiated, isCascadeDetach, isCascadeMerge, isCascadeOnDeleteSetOnDatabase, isCascadePersist, isCascadeRefresh, isCascadeRemove, isExtendingPessimisticLockScope, isForeignReferenceMapping, isInnerJoinFetched, isJoinFetched, isLazy, isOuterJoinFetched, isPrivateOwned, iterate, mergeRemoteValueHolder, preInitialize, prepareHistoricalQuery, prepareNestedJoinQueryClone, privateOwnedRelationship, readFromRowIntoObject, requiresTransientWeavedFields, setBatchFetchType, setCascadeAll, setCascadeDetach, setCascadeMerge, setCascadePersist, setCascadeRefresh, setCascadeRemove, setCustomSelectionQuery, setForceInitializationOfSelectionCriteria, setHasCustomSelectionQuery, setIndirectionPolicy, setIsCacheable, setIsCascadeOnDeleteSetOnDatabase, setIsPrivateOwned, setJoinFetch, setMappedBy, setPartitioningPolicy, setPartitioningPolicyName, setRealAttributeValueInObject, setReferenceDescriptor, setRelationshipPartner, setRelationshipPartnerAttributeName, setRequiresTransientWeavedFields, setSelectionCall, setSelectionQuery, setSelectionSQLString, setShouldExtendPessimisticLockScope, setTempSession, setUsesBatchReading, setUsesIndirection, shouldExtendPessimisticLockScope, shouldExtendPessimisticLockScopeInDedicatedQuery, shouldExtendPessimisticLockScopeInSourceQuery, shouldExtendPessimisticLockScopeInTargetQuery, shouldForceInitializationOfSelectionCriteria, shouldInitializeSelectionCriteria, shouldMergeCascadeParts, shouldMergeCascadeReference, shouldObjectModifyCascadeToParts, shouldRefreshCascadeParts, shouldUseBatchReading, shouldUseValueFromRowWithJoin, trimRowForJoin, trimRowForJoin, useBasicIndirection, useBatchReading, useContainerIndirection, useInnerJoinFetch, useOuterJoinFetch, usesIndirection, useWeavedIndirection, valueFromRowInternal, valueFromRowInternal
Methods inherited from class org.eclipse.persistence.mappings.DatabaseMapping
addUnconvertedProperty, buildObjectJoinExpression, buildObjectJoinExpression, buildShallowOriginalFromRow, cloneFields, collectFields, convertConverterClassNamesToClasses, derivesId, earlyPreDelete, extractNestedExpressions, extractNestedNonAggregateExpressions, getAttributeAccessor, getAttributeName, getDerivedIdMapping, getDescriptor, getField, getFieldClassification, getFields, getGetMethodName, getMapsIdValue, getProperties, getProperty, getRealAttributeValueFromObject, getSetMethodName, getUnconvertedProperties, getWeight, hasConstraintDependency, hasInverseConstraintDependency, hasMapsIdValue, hasRootExpressionThatShouldUseOuterJoin, hasUnconvertedProperties, isAbstractColumnMapping, isAbstractCompositeCollectionMapping, isAbstractCompositeDirectCollectionMapping, isAbstractCompositeObjectMapping, isAbstractDirectMapping, isAggregateCollectionMapping, isAggregateMapping, isAggregateObjectMapping, isCacheable, isCloningRequired, isDatabaseMapping, isDirectToFieldMapping, isDirectToXMLTypeMapping, isEISMapping, isInAndOutSopObject, isInOnlySopObject, isInSopObject, isJPAId, isManyToManyMapping, isManyToOneMapping, isMapKeyMapping, isMultitenantPrimaryKeyMapping, isNestedTableMapping, isObjectReferenceMapping, isOneToManyMapping, isOneToOneMapping, isOptional, isOutOnlySopObject, isOutSopObject, isPrimaryKeyMapping, isReadOnly, isReferenceMapping, isRemotelyInitialized, isStructureMapping, isTransformationMapping, isUnidirectionalOneToManyMapping, isUsingMethodAccess, isVariableOneToOneMapping, isWriteOnly, isXMLMapping, postCalculateChangesOnDeleted, postInitializeSourceAndTargetExpressions, prepareCascadeLockingPolicy, readFromResultSetIntoObject, readOnly, readWrite, rehashFieldDependancies, remotelyInitialized, setAttributeAccessor, setAttributeName, setAttributeValueInObject, setDerivedIdMapping, setDerivesId, setDescriptor, setFields, setGetMethodName, setIsInAndOutSopObject, setIsInSopObject, setIsJPAId, setIsLazy, setIsMapKeyMapping, setIsOptional, setIsOutSopObject, setIsPrimaryKeyMapping, setIsReadOnly, setMapsIdValue, setProperties, setProperty, setSetMethodName, setWeight, toString, validateAfterInitialization, valueFromObject, valueFromResultSet, valueFromRow, writeFromAttributeIntoRow, writeFromObjectIntoRow, writeFromObjectIntoRowForShallowInsert, writeFromObjectIntoRowForShallowInsertWithChangeRecord, writeFromObjectIntoRowForUpdate, writeFromObjectIntoRowForUpdateAfterShallowInsert, writeFromObjectIntoRowForUpdateBeforeShallowDelete, writeFromObjectIntoRowForWhereClause, writeFromObjectIntoRowWithChangeRecord, writeInsertFieldsIntoRow, writeUpdateFieldsIntoRow
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.eclipse.persistence.mappings.foundation.MapComponentMapping
clone
-
Constructor Details
-
DirectMapMapping
public DirectMapMapping()DirectMapCollectionMapping constructor
-
-
Method Details
-
setContainerPolicy
ADVANCED: Configure the mapping to use a container policy. This must be a MappedKeyMapContainerPolicy policy. Set the valueMapping for the policy.- Specified by:
setContainerPolicy
in interfaceContainerMapping
- Overrides:
setContainerPolicy
in classDirectCollectionMapping
-
getKeyConverter
PUBLIC: Return the converter on the mapping. A converter can be used to convert between the key's object value and database value. -
setKeyConverter
PUBLIC: Set the converter on the mapping. A converter can be used to convert between the key's object value and database value. -
setKeyConverterClassName
INTERNAL: Set the converter class name on the mapping. Initialized in convertClassNamesToClasses. A converter can be used to convert between the key's object value and database value. -
addToCollectionChangeRecord
public void addToCollectionChangeRecord(Object newKey, Object newValue, ObjectChangeSet objectChangeSet, UnitOfWorkImpl uow) throws DescriptorException INTERNAL: Add a new value and its change set to the collection change record. This is used by attribute change tracking. If a value has changed then issue a remove first with the key then an add.- Throws:
DescriptorException
-
buildCloneForPartObject
public Object buildCloneForPartObject(Object attributeValue, Object original, CacheKey cacheKey, Object clone, AbstractSession cloningSession, Integer refreshCascade, boolean isExisting, boolean isFromSharedCache) INTERNAL: Require for cloning, the part must be cloned. Ignore the objects, use the attribute value.- Overrides:
buildCloneForPartObject
in classCollectionMapping
- Parameters:
attributeValue
- TODOoriginal
- TODOcacheKey
- TODOclone
- TODOcloningSession
- TODOrefreshCascade
- TODOisExisting
- TODOisFromSharedCache
- TODO- Returns:
- TODO
-
calculateDeferredChanges
INTERNAL: Used by AttributeLevelChangeTracking to update a changeRecord with calculated changes as opposed to detected changes. If an attribute can not be change tracked it's changes can be detected through this process.- Overrides:
calculateDeferredChanges
in classDirectCollectionMapping
- Parameters:
changeRecord
- TODOsession
- TODO
-
cascadeDiscoverAndPersistUnregisteredNewObjects
public void cascadeDiscoverAndPersistUnregisteredNewObjects(Object object, Map newObjects, Map unregisteredExistingObjects, Map visitedObjects, UnitOfWorkImpl uow, Set cascadeErrors) INTERNAL: Cascade discover and persist new objects during commit.- Overrides:
cascadeDiscoverAndPersistUnregisteredNewObjects
in classDirectCollectionMapping
- Parameters:
object
- TODOnewObjects
- TODOunregisteredExistingObjects
- TODOvisitedObjects
- TODOuow
- TODOcascadeErrors
- TODO
-
cascadePerformRemoveIfRequired
INTERNAL: Cascade perform delete through mappings that require the cascade- Overrides:
cascadePerformRemoveIfRequired
in classDirectCollectionMapping
- Parameters:
object
- TODOuow
- TODOvisitedObjects
- TODO
-
cascadeRegisterNewIfRequired
INTERNAL: Cascade registerNew for Create through mappings that require the cascade- Overrides:
cascadeRegisterNewIfRequired
in classDirectCollectionMapping
- Parameters:
object
- TODOuow
- TODOvisitedObjects
- TODO
-
compareCollectionsForChange
public void compareCollectionsForChange(Object oldCollection, Object newCollection, ChangeRecord changeRecord, AbstractSession session) INTERNAL: This method is used to calculate the differences between two collections.- Overrides:
compareCollectionsForChange
in classDirectCollectionMapping
-
compareForChange
public ChangeRecord compareForChange(Object clone, Object backUp, ObjectChangeSet owner, AbstractSession session) INTERNAL: This method compares the changes between two direct collections. Comparisons are made on equality not identity.- Overrides:
compareForChange
in classDirectCollectionMapping
- Parameters:
clone
- TODObackUp
- TODOowner
- TODOsession
- TODO- Returns:
- prototype.changeset.ChangeRecord TODO
-
compareObjects
INTERNAL: Compare the attributes belonging to this mapping for the objects.- Overrides:
compareObjects
in classDirectCollectionMapping
- Parameters:
firstObject
- TODOsecondObject
- TODOsession
- TODO- Returns:
- TODO
-
convertClassNamesToClasses
Description copied from class:DirectCollectionMapping
INTERNAL: Convert all the class-name-based settings in this mapping to actual class-based settings This method is implemented by subclasses as necessary.- Overrides:
convertClassNamesToClasses
in classDirectCollectionMapping
- Parameters:
classLoader
- TODO
-
createMapComponentFromRow
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. Returns the key.- Specified by:
createMapComponentFromRow
in interfaceMapComponentMapping
-
getDirectKeyField
INTERNAL: -
initialize
INTERNAL: Initialize and validate the mapping properties.- Overrides:
initialize
in classDirectCollectionMapping
- Throws:
DescriptorException
-
initializeDeleteQuery
- Overrides:
initializeDeleteQuery
in classDirectCollectionMapping
-
initializeInsertQuery
Initialize insert query. This query is used to insert the collection of objects into the reference table.- Overrides:
initializeInsertQuery
in classDirectCollectionMapping
-
initializeSelectionStatement
- Overrides:
initializeSelectionStatement
in classDirectCollectionMapping
-
iterateOnRealAttributeValue
INTERNAL: Iterate on the attribute value. The value holder has already been processed. PERF: Avoid iteration if not required.- Overrides:
iterateOnRealAttributeValue
in classDirectCollectionMapping
-
iterateOnElement
INTERNAL: Iterate on the specified element.- Overrides:
iterateOnElement
in classDirectCollectionMapping
-
isDirectMapMapping
public boolean isDirectMapMapping()INTERNAL: Related mapping should implement this method to return true.- Overrides:
isDirectMapMapping
in classDatabaseMapping
-
mergeChangesIntoObject
public void mergeChangesIntoObject(Object target, ChangeRecord changeRecord, Object source, MergeManager mergeManager, AbstractSession targetSession) INTERNAL: Merge changes from the source to the target object. Because this is a collection mapping, values are added to or removed from the collection based on the changeset.- Overrides:
mergeChangesIntoObject
in classDirectCollectionMapping
-
mergeIntoObject
public void mergeIntoObject(Object target, boolean isTargetUnInitialized, Object source, MergeManager mergeManager, AbstractSession targetSession) INTERNAL: Merge changes from the source to the target object.- Overrides:
mergeIntoObject
in classDirectCollectionMapping
-
performDataModificationEvent
public void performDataModificationEvent(Object[] event, AbstractSession session) throws DatabaseException, DescriptorException INTERNAL: Perform the commit event. This is used in the uow to delay data modifications. This is mostly dealt with in the superclass. Private Owned deletes require extra functionality- Overrides:
performDataModificationEvent
in classDirectCollectionMapping
- Throws:
DatabaseException
DescriptorException
-
postCalculateChanges
INTERNAL: Overridden by mappings that require additional processing of the change record after the record has been calculated.- Overrides:
postCalculateChanges
in classDirectCollectionMapping
-
postInsert
INTERNAL: Insert the private owned object.- Overrides:
postInsert
in classDirectCollectionMapping
- Throws:
DatabaseException
-
postUpdateWithChangeSet
INTERNAL: Update private owned part.- Overrides:
postUpdateWithChangeSet
in classDirectCollectionMapping
- Throws:
DatabaseException
-
preDelete
INTERNAL: Propagate the preDelete event through the container policy if necessary- Overrides:
preDelete
in classDirectCollectionMapping
- Throws:
DatabaseException
-
initOrRebuildSelectQuery
protected void initOrRebuildSelectQuery()INTERNAL: Rebuild select query.- Overrides:
initOrRebuildSelectQuery
in classDirectCollectionMapping
-
recordPrivateOwnedRemovals
INTERNAL: Overridden by mappings that require additional processing of the change record after the record has been calculated.- Overrides:
recordPrivateOwnedRemovals
in classDirectCollectionMapping
-
removeFromCollectionChangeRecord
protected void removeFromCollectionChangeRecord(Object newKey, Object newValue, ObjectChangeSet objectChangeSet, UnitOfWorkImpl uow) throws DescriptorException INTERNAL: Remove a value and its change set from the collection change record. This is used by attribute change tracking.- Throws:
DescriptorException
-
setDirectKeyField
INTERNAL: -
setDirectKeyFieldClassification
ADVANCED: Set the class type of the field value. This can be used if field value differs from the object value, has specific typing requirements such as usage of java.sql.Blob or NChar. This must be called after the field name has been set. -
setDirectKeyFieldClassificationName
ADVANCED: Set the class type name of the field value. This can be used if field value differs from the object value, has specific typing requirements such as usage of java.sql.Blob or NChar. This must be called after the direct key field has been set. -
setDirectKeyFieldName
PUBLIC: Set the direct key field name in the reference table. This is the field that the primitive data value of the Map key is stored in. -
updateChangeRecord
public void updateChangeRecord(Object clone, Object newValue, Object oldValue, ObjectChangeSet objectChangeSet, 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 classDirectCollectionMapping
- Throws:
DescriptorException
-
updateCollectionChangeRecord
public void updateCollectionChangeRecord(CollectionChangeEvent event, ObjectChangeSet changeSet, UnitOfWorkImpl uow) INTERNAL: Add or removes a new value and its change set to the collection change record based on the event passed in. This is used by attribute change tracking.- Overrides:
updateCollectionChangeRecord
in classDirectCollectionMapping
-
useMapClass
PUBLIC: Configure the mapping to use an instance of the specified container class to hold the target objects.The default container class is java.util.Hashtable.
The container class must implements (directly or indirectly) the Map interface.
Note: Do not use both useMapClass(Class concreteClass), useTransparentMap(). The last use of one of the two methods will override the previous one.
- Overrides:
useMapClass
in classCollectionMapping
-
useTransparentMap
public void useTransparentMap()PUBLIC: Configure the mapping to use an instance of the specified container class to hold the target objects.The container class must implement (directly or indirectly) the Map interface.
Note: Do not use both useMapClass(Class concreteClass), useTransparentMap(). The last use of one of the two methods will override the previous one.
-
setKeyClass
PUBLIC: This is a helper method to set the key converter to a TypeConversionConverter. This ensures that the key value from the database is converted to the correct Java type. The converter can also be set directly. Note that setting the converter to another converter will overwrite this setting. -
getKeyClass
PUBLIC: This is a helper method to get the object class from the key converter if it is a TypeConversionConverter. This returns null if not using a TypeConversionConverter key converter. -
setValueClass
PUBLIC: This is a helper method to set the value converter to a TypeConversionConverter. This ensures that the value from the database is converted to the correct Java type. The converter can also be set directly. Note that setting the converter to another converter will overwrite this setting. -
simpleAddToCollectionChangeRecord
public void simpleAddToCollectionChangeRecord(Object referenceKey, Object objectToAdd, ObjectChangeSet changeSet, AbstractSession session) ADVANCED: This method is used to have an object add to a collection once the changeSet is applied The referenceKey parameter should only be used for direct Maps.- Overrides:
simpleAddToCollectionChangeRecord
in classDirectCollectionMapping
-
simpleRemoveFromCollectionChangeRecord
public void simpleRemoveFromCollectionChangeRecord(Object referenceKey, Object objectToRemove, ObjectChangeSet changeSet, AbstractSession session) ADVANCED: This method is used to have an object removed from a collection once the changeSet is applied The referenceKey parameter should only be used for direct Maps.- Overrides:
simpleRemoveFromCollectionChangeRecord
in classDirectCollectionMapping
-
getValueClass
PUBLIC: This is a helper method to get the object class from the value converter if it is a TypeConversionConverter. This returns null if not using a TypeConversionConverter value converter. -
executeBatchQuery
protected void executeBatchQuery(DatabaseQuery query, CacheKey parentCacheKey, Map referenceDataByKey, AbstractSession session, AbstractRecord translationRow) INTERNAL: Prepare and execute the batch query and store the results for each source object in a map keyed by the mappings source keys of the source objects.- Overrides:
executeBatchQuery
in classDirectCollectionMapping
-
valueFromRowInternalWithJoin
protected Object valueFromRowInternalWithJoin(AbstractRecord row, JoinedAttributeManager joinManager, ObjectBuildingQuery sourceQuery, CacheKey parentCacheKey, AbstractSession executionSession, boolean isTargetProtected) throws DatabaseException INTERNAL: Return the value of the field from the row or a value holder on the query to obtain the object.- Overrides:
valueFromRowInternalWithJoin
in classDirectCollectionMapping
- Throws:
DatabaseException
-