Module org.eclipse.persistence.core
Class MappedKeyMapContainerPolicy
java.lang.Object
org.eclipse.persistence.internal.queries.ContainerPolicy
org.eclipse.persistence.internal.queries.InterfaceContainerPolicy
org.eclipse.persistence.internal.queries.MapContainerPolicy
org.eclipse.persistence.internal.queries.MappedKeyMapContainerPolicy
- All Implemented Interfaces:
Serializable
,Cloneable
,CoreContainerPolicy<AbstractSession>
,CoreMappedKeyMapContainerPolicy<AbstractSession>
public class MappedKeyMapContainerPolicy
extends MapContainerPolicy
implements CoreMappedKeyMapContainerPolicy<AbstractSession>
A MappedKeyMapContainerPolicy should be used for mappings to implementers of Map.
It differs from MapContainerPolicy by allowing the MapKey to be an otherwise unmapped
column in a table rather than a mapped element of the value in the map.
This container policy holds a reference to a KeyMapping that will be used to construct the key
from the database and a reference to its owner which creates the value for the map.
The key of the map can be any implementer of MapKeyMapping and the data representing the
key can either be stored in the target table of the value mapping, or in a collection table that
associates the source to the target. The data can either be everything necessary to compose the
key, or foreign keys that allow the key to be retrieved
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.persistence.internal.queries.MapContainerPolicy
MapContainerPolicy.MapContainerPolicyIterator
-
Field Summary
Fields inherited from class org.eclipse.persistence.internal.queries.MapContainerPolicy
elementClass, elementClassName, keyField, keyMethod, keyName
Fields inherited from class org.eclipse.persistence.internal.queries.InterfaceContainerPolicy
cloneMethod, containerClass, containerClassName
Fields inherited from class org.eclipse.persistence.internal.queries.ContainerPolicy
constructor, defaultContainerClass, elementDescriptor
-
Constructor Summary
ConstructorDescriptionINTERNAL: Construct a new policy.MappedKeyMapContainerPolicy
(Class<?> containerClass) INTERNAL: Construct a new policy for the specified class.MappedKeyMapContainerPolicy
(String containerClassName) INTERNAL: Construct a new policy for the specified class name. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAdditionalFieldsToQuery
(ReadQuery selectionQuery, Expression baseExpression) INTERNAL: Called when the selection query is being initialize to add the fields for the key to the queryvoid
addFieldsForMapKey
(AbstractRecord joinRow) INTERNAL: Called when the insert query is being initialized to ensure the fields for the key are in the insert queryboolean
addInto
(Object element, Object container, AbstractSession session) INTERNAL: Add element into container which implements the Map interface.boolean
addInto
(Object element, Object container, AbstractSession session, AbstractRecord row, DataReadQuery query, CacheKey parentCacheKey, boolean isTargetProtected) INTERNAL: This is used for ordered List containers to add all of the elements to the collection in the order of the index field in the row.boolean
addInto
(Object element, Object container, AbstractSession session, AbstractRecord dbRow, ObjectBuildingQuery query, CacheKey parentCacheKey, boolean isTargetProtected) INTERNAL: Add element to that implements the Map interface use the row to compute the keyvoid
addNestedJoinsQueriesForMapKey
(JoinedAttributeManager joinManager, ObjectLevelReadQuery query, AbstractSession session) INTERNAL: Used for joining.buildCloneForKey
(Object key, Object parent, CacheKey parentCacheKey, Integer refreshCascade, AbstractSession cloningSession, boolean isExisting, boolean isCacheCheckComplete) Build a clone for the key of a Map represented by this container policy.buildKey
(AbstractRecord row, ObjectBuildingQuery query, CacheKey parentCacheKey, AbstractSession session, boolean isTargetProtected) Extract the key for the map from the provided row.buildKeyFromJoinedRow
(AbstractRecord row, JoinedAttributeManager joinManager, ObjectBuildingQuery query, CacheKey parentCacheKey, AbstractSession session, boolean isTargetProtected) Extract the key for the map from the provided row.Object[]
buildReferencesPKList
(Object container, AbstractSession session) INTERNAL: This method will access the target relationship and create a list of information to rebuild the collection.INTERNAL: Certain key mappings favor different types of selection query.void
cascadeDiscoverAndPersistUnregisteredNewObjects
(Object object, Map newObjects, Map unregisteredExistingObjects, Map visitedObjects, UnitOfWorkImpl uow, Set cascadeErrors) INTERNAL: Cascade discover and persist new objects during commit to the map keyvoid
cascadePerformRemoveIfRequired
(Object object, UnitOfWorkImpl uow, Map visitedObjects) INTERNAL: Cascade registerNew to any mappings managed by the container policy.void
cascadeRegisterNewIfRequired
(Object object, UnitOfWorkImpl uow, Map visitedObjects) INTERNAL: Cascade registerNew to any mappings managed by the container policy.clone()
INTERNAL: The mapping clones itself to create deep copy.boolean
compareContainers
(Object firstObjectMap, Object secondObjectMap) INTERNAL: Return true if keys are the same.boolean
compareKeys
(Object sourceValue, AbstractSession session) INTERNAL: Return true if keys are the same in the source as the backup.void
convertClassNamesToClasses
(ClassLoader classLoader) INTERNAL: Convert all the class-name-based settings in this ContainerPolicy to actual class-based settingsprotected void
createChangeSetForKeys
(Map originalKeyValues, CollectionChangeRecord changeRecord, AbstractSession session, ClassDescriptor referenceDescriptor) INTERNAL: Create change sets that contain map keys.INTERNAL: Create a query key that links to the map key.createWrappedObjectFromExistingWrappedObject
(Object wrappedObject, Object parent, ClassDescriptor referenceDescriptor, MergeManager mergeManager, AbstractSession targetSession) INTERNAL: This method will actually potentially wrap an object in two ways.void
deleteWrappedObject
(Object objectDeleted, AbstractSession session) INTERNAL: Delete the key and value of the passed association passed object.getAdditionalFieldsForJoin
(CollectionMapping baseMapping) INTERNAL: Return any additional fields required by the policy for a fetch join.INTERNAL: Return any tables that will be required when this mapping is used as part of a join query.getCloneDataFromChangeSet
(ObjectChangeSet changeSet) INTERNAL: Used when objects are added or removed during an update.INTERNAL: Return the reference descriptor for the map key if it exists.getDirectKeyField
(CollectionMapping baseMapping) INTERNAL: Return the DatabaseField that represents the key in a DirectMapMapping.INTERNAL: Return a Map of any foreign keys defined within the the MapKey.INTERNAL: Return the fields that make up the identity of the mapped object.INTERNAL: Get the Converter for the key of this mapping if one exists.getKeyMappingDataForWriteQuery
(Object object, AbstractSession session) INTERNAL: Add any non-Foreign-key data from an Object describe by a MapKeyMapping to a database row This is typically used in write queries to ensure all the data stored in the collection table is included in the query.INTERNAL: Some map keys must be obtained from the database.INTERNAL: Get the selection criteria for the map key.INTERNAL: Return the type of the map key, this will be overridden by container policies that allow maps.void
initialize
(AbstractSession session, DatabaseTable keyTable) INTERNAL: Initialize the key mappingprotected boolean
CollectionTableMapContainerPolicy is for mappings where the key is stored in a table separately from the map element.boolean
INTERNAL: Return whether a map key this container policy represents is an attribute By default this method will return false since only subclasses actually represent maps.boolean
INTERNAL: Return if the map key this container policy represents is a OneToOne.boolean
void
iterateOnMapKey
(DescriptorIterator iterator, Object element) INTERNAL: Used in Descriptor Iteration to iterate on map keys.keyFrom
(Object element, AbstractSession session) INTERNAL: Return the key for the specified element.void
postCalculateChanges
(Object key, Object value, ClassDescriptor referenceDescriptor, DatabaseMapping mapping, UnitOfWorkImpl uow) INTERNAL: Add the provided object to the deleted objects list on the commit manager.void
postCalculateChanges
(ObjectChangeSet ocs, ClassDescriptor referenceDescriptor, DatabaseMapping mapping, UnitOfWorkImpl uow) INTERNAL: Add the provided object to the deleted objects list on the commit manager.void
postInitialize
(AbstractSession session) INTERNAL: Some subclasses need to post initialize mappings associated with them.void
INTERNAL: This method is used to check the key mapping to ensure that it does not write to a field that is written by another mapping.boolean
INTERNAL: Returns true if the key mapping is an AggregateObjectMapping.void
propogatePostDelete
(DeleteObjectQuery query, Object object) INTERNAL: Propagate the postDeleteEvent to any additional objects the query is aware ofvoid
propogatePostInsert
(WriteObjectQuery query, Object object) INTERNAL: Propagate the postDeleteEvent to any additional objects the query is aware ofvoid
propogatePostUpdate
(WriteObjectQuery query, Object object) INTERNAL: Propagate the postDeleteEvent to any additional objects the query is aware ofvoid
propogatePreDelete
(DeleteObjectQuery query, Object object) INTERNAL: Propagate the postDeleteEvent to any additional objects the query is aware ofvoid
propogatePreInsert
(WriteObjectQuery query, Object object) INTERNAL: Propagate the postDeleteEvent to any additional objects the query is aware ofvoid
propogatePreUpdate
(WriteObjectQuery query, Object object) INTERNAL: Propagate the postDeleteEvent to any additional objects the query is aware ofvoid
recordPrivateOwnedRemovals
(Object object, ClassDescriptor referenceDescriptor, UnitOfWorkImpl uow) INTERNAL: Add the key and value from provided association to the deleted objects list on the commit manager.boolean
INTERNAL: Returns whether this ContainerPolicy requires data modification events when objects are added or deleted during update.void
setDescriptorForKeyMapping
(ClassDescriptor descriptor) INTERNAL: Used during initialization of DirectMapMapping.void
setKeyConverter
(Converter keyConverter, DirectMapMapping mapping) INTERNAL: Set a converter on the KeyField of a DirectCollectionMapping.void
setKeyConverterClassName
(String keyConverterClassName, DirectMapMapping mapping) INTERNAL: Set the name of the class to be used as a converter for the key of a DirectMapMaping.void
setKeyField
(DatabaseField keyField, ClassDescriptor descriptor) INTERNAL: Set the DatabaseField that will represent the key in a DirectMapMapping.void
setKeyMapping
(MapKeyMapping mapping) void
setKeyQuery
(DatabaseQuery keyQuery) INTERNAL: Some map keys must be obtained from the database.void
setValueMapping
(MapComponentMapping mapping) boolean
INTERNAL: Return whether data for a map key must be included on a Delete datamodification event If the keyMapping is privateOwned, that data should be.boolean
INTERNAL: Certain types of container policies require an extra update statement after a relationship is inserted.unwrapKey
(Object key, AbstractSession session) INTERNAL: Allow the key to be unwrapped.int
updateJoinedMappingIndexesForMapKey
(Map<DatabaseMapping, Object> indexList, int index) INTERNAL: Update the joined mapping indices Adds the key mapping and it's index to the list of joined mappings.valueFromPKList
(Object[] pks, AbstractRecord foreignKeys, ForeignReferenceMapping mapping, AbstractSession session) INTERNAL: This method is used to load a relationship from a list of PKs.Methods inherited from class org.eclipse.persistence.internal.queries.MapContainerPolicy
addInto, addNextValueFromIteratorInto, buildChangeSetForNewObjectInCollection, buildCloneForValue, buildCollectionEntry, clear, cloneFor, concatenateContainers, contains, createChangeEvent, getElementClass, getElementClassName, getInterfaceType, getKeyName, hasNext, initializeKey, isMapPolicy, isValidContainer, iteratorFor, keyFromEntry, keyFromIterator, next, nextEntry, nextEntry, prepare, recordUpdateToCollectionInChangeRecord, removeFrom, setElementClass, setKeyMethod, setKeyMethod, setKeyMethodName, setKeyName, setKeyName, setKeyName, sizeFor, unwrapElement, unwrapIteratorResult
Methods inherited from class org.eclipse.persistence.internal.queries.InterfaceContainerPolicy
buildContainerFromVector, equals, getCloneMethod, getCloneMethod, getContainerClass, getContainerClassName, hashCode, invokeCloneMethodOn, isValidContainerType, setCloneMethod, setContainerClass, setContainerClassName, toStringInfo
Methods inherited from class org.eclipse.persistence.internal.queries.ContainerPolicy
addAll, addAll, buildDefaultPolicy, buildPolicyFor, buildPolicyFor, clone, collectObjectForNewCollection, compareCollectionsForChange, containerInstance, containerInstance, contains, copyMapDataToRow, execute, getChangeValuesFrom, getConstructor, getDefaultContainerClass, getElementDescriptor, hasElementDescriptor, hasOrder, initializeConstructor, isCollectionPolicy, isCursoredStreamPolicy, isCursorPolicy, isDirectMapPolicy, isEmpty, isListPolicy, isOrderedListPolicy, isScrollableCursorPolicy, mergeCascadeParts, mergeChanges, mergeChanges, next, overridesRead, prepareForExecution, recordAddToCollectionInChangeRecord, recordRemoveFromCollectionInChangeRecord, remoteExecute, removeFrom, removeFrom, setConstructor, setDefaultContainerClass, setElementDescriptor, shouldAddAll, toString, updateChangeRecordForSelfMerge, vectorFor
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.eclipse.persistence.internal.core.queries.CoreContainerPolicy
addInto, clear, containerInstance, containerInstance, contains, hasNext, isEmpty, isListPolicy, iteratorFor, next, nextEntry, nextEntry, removeFrom, setContainerClass, sizeFor, vectorFor
-
Field Details
-
keyMapping
-
valueMapping
-
keyQuery
-
-
Constructor Details
-
MappedKeyMapContainerPolicy
public MappedKeyMapContainerPolicy()INTERNAL: Construct a new policy. -
MappedKeyMapContainerPolicy
INTERNAL: Construct a new policy for the specified class. -
MappedKeyMapContainerPolicy
INTERNAL: Construct a new policy for the specified class name.
-
-
Method Details
-
addAdditionalFieldsToQuery
INTERNAL: Called when the selection query is being initialize to add the fields for the key to the query- Overrides:
addAdditionalFieldsToQuery
in classContainerPolicy
- See Also:
-
getKeyMappingDataForWriteQuery
INTERNAL: Add any non-Foreign-key data from an Object describe by a MapKeyMapping to a database row This is typically used in write queries to ensure all the data stored in the collection table is included in the query.- Overrides:
getKeyMappingDataForWriteQuery
in classContainerPolicy
-
getKeyType
INTERNAL: Return the type of the map key, this will be overridden by container policies that allow maps.- Overrides:
getKeyType
in classMapContainerPolicy
-
addFieldsForMapKey
INTERNAL: Called when the insert query is being initialized to ensure the fields for the key are in the insert query- Overrides:
addFieldsForMapKey
in classContainerPolicy
- See Also:
-
addInto
INTERNAL: Add element into container which implements the Map interface. The may be used by merging/cloning passing a Map.Entry.- Specified by:
addInto
in interfaceCoreContainerPolicy<AbstractSession>
- Overrides:
addInto
in classMapContainerPolicy
-
addInto
public boolean addInto(Object element, Object container, AbstractSession session, AbstractRecord row, DataReadQuery query, CacheKey parentCacheKey, boolean isTargetProtected) INTERNAL: This is used for ordered List containers to add all of the elements to the collection in the order of the index field in the row. This is currently only used by OrderListContainerPolicy, so this is just a stub. The passing of the query is to allow future compatibility with Maps (ordered Map).- Overrides:
addInto
in classContainerPolicy
-
addInto
public boolean addInto(Object element, Object container, AbstractSession session, AbstractRecord dbRow, ObjectBuildingQuery query, CacheKey parentCacheKey, boolean isTargetProtected) INTERNAL: Add element to that implements the Map interface use the row to compute the key- Overrides:
addInto
in classContainerPolicy
-
addNestedJoinsQueriesForMapKey
public void addNestedJoinsQueriesForMapKey(JoinedAttributeManager joinManager, ObjectLevelReadQuery query, AbstractSession session) INTERNAL: Used for joining. Add any queries necessary for joining to the join manager- Overrides:
addNestedJoinsQueriesForMapKey
in classContainerPolicy
-
buildCloneForKey
public Object buildCloneForKey(Object key, Object parent, CacheKey parentCacheKey, Integer refreshCascade, AbstractSession cloningSession, boolean isExisting, boolean isCacheCheckComplete) Build a clone for the key of a Map represented by this container policy.- Overrides:
buildCloneForKey
in classContainerPolicy
-
buildSelectionQueryForDirectCollectionMapping
INTERNAL: Certain key mappings favor different types of selection query. Return the appropriate type of selectionQuery.- Overrides:
buildSelectionQueryForDirectCollectionMapping
in classContainerPolicy
-
buildKey
public Object buildKey(AbstractRecord row, ObjectBuildingQuery query, CacheKey parentCacheKey, AbstractSession session, boolean isTargetProtected) Extract the key for the map from the provided row.- Overrides:
buildKey
in classContainerPolicy
-
buildKeyFromJoinedRow
public Object buildKeyFromJoinedRow(AbstractRecord row, JoinedAttributeManager joinManager, ObjectBuildingQuery query, CacheKey parentCacheKey, AbstractSession session, boolean isTargetProtected) Extract the key for the map from the provided row.- Overrides:
buildKeyFromJoinedRow
in classContainerPolicy
-
buildReferencesPKList
INTERNAL: This method will access the target relationship and create a list of information to rebuild the collection. For the MapContainerPolicy this return will consist of an array with serial Map entry key and value elements.- Overrides:
buildReferencesPKList
in classMapContainerPolicy
- See Also:
-
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 to the map key- Overrides:
cascadeDiscoverAndPersistUnregisteredNewObjects
in classContainerPolicy
-
cascadePerformRemoveIfRequired
INTERNAL: Cascade registerNew to any mappings managed by the container policy. This will cascade the register to the key mapping.- Overrides:
cascadePerformRemoveIfRequired
in classContainerPolicy
-
cascadeRegisterNewIfRequired
INTERNAL: Cascade registerNew to any mappings managed by the container policy. This will cascade the register to the key mapping.- Overrides:
cascadeRegisterNewIfRequired
in classContainerPolicy
-
clone
INTERNAL: The mapping clones itself to create deep copy.- Overrides:
clone
in classContainerPolicy
-
compareContainers
INTERNAL: Return true if keys are the same. False otherwise -
compareKeys
INTERNAL: Return true if keys are the same in the source as the backup. False otherwise in the case of read-only compare against the original.- Overrides:
compareKeys
in classMapContainerPolicy
-
createChangeSetForKeys
protected void createChangeSetForKeys(Map originalKeyValues, CollectionChangeRecord changeRecord, AbstractSession session, ClassDescriptor referenceDescriptor) INTERNAL: Create change sets that contain map keys.- Overrides:
createChangeSetForKeys
in classContainerPolicy
-
createQueryKeyForMapKey
INTERNAL: Create a query key that links to the map key.- Overrides:
createQueryKeyForMapKey
in classMapContainerPolicy
-
createWrappedObjectFromExistingWrappedObject
public Object createWrappedObjectFromExistingWrappedObject(Object wrappedObject, Object parent, ClassDescriptor referenceDescriptor, MergeManager mergeManager, AbstractSession targetSession) INTERNAL: This method will actually potentially wrap an object in two ways. It will first wrap the object based on the referenceDescriptor's wrapper policy. It will also potentially do some wrapping based on what is required by the container policy.- Overrides:
createWrappedObjectFromExistingWrappedObject
in classMapContainerPolicy
- Parameters:
parent
- if this is an aggregate, the owner of the aggregate- See Also:
-
convertClassNamesToClasses
INTERNAL: Convert all the class-name-based settings in this ContainerPolicy to actual class-based settings- Overrides:
convertClassNamesToClasses
in classMapContainerPolicy
-
deleteWrappedObject
INTERNAL: Delete the key and value of the passed association passed object.- Overrides:
deleteWrappedObject
in classContainerPolicy
- See Also:
-
getAdditionalTablesForJoinQuery
INTERNAL: Return any tables that will be required when this mapping is used as part of a join query.- Overrides:
getAdditionalTablesForJoinQuery
in classContainerPolicy
-
getAdditionalFieldsForJoin
INTERNAL: Return any additional fields required by the policy for a fetch join.- Overrides:
getAdditionalFieldsForJoin
in classContainerPolicy
-
getForeignKeyFieldsForMapKey
INTERNAL: Return a Map of any foreign keys defined within the the MapKey. -
getDescriptorForMapKey
INTERNAL: Return the reference descriptor for the map key if it exists.- Overrides:
getDescriptorForMapKey
in classContainerPolicy
-
getCloneDataFromChangeSet
INTERNAL: Used when objects are added or removed during an update. This method returns either the clone from the ChangeSet or a packaged version of it that contains things like map keys.- Overrides:
getCloneDataFromChangeSet
in classContainerPolicy
-
getDirectKeyField
INTERNAL: Return the DatabaseField that represents the key in a DirectMapMapping. If the keyMapping is not a DirectMapping, this will return null.- Overrides:
getDirectKeyField
in classMapContainerPolicy
-
getIdentityFieldsForMapKey
INTERNAL: Return the fields that make up the identity of the mapped object. For mappings with a primary key, it will be the set of fields in the primary key. For mappings without a primary key it will likely be all the fields.- Overrides:
getIdentityFieldsForMapKey
in classContainerPolicy
-
getKeyConverter
INTERNAL: Get the Converter for the key of this mapping if one exists. -
getKeyMapping
-
getKeyQuery
INTERNAL: Some map keys must be obtained from the database. This query is used to obtain the key. -
getKeySelectionCriteria
INTERNAL: Get the selection criteria for the map key.- Overrides:
getKeySelectionCriteria
in classContainerPolicy
-
getValueMapping
-
initialize
INTERNAL: Initialize the key mapping- Overrides:
initialize
in classContainerPolicy
-
isKeyAvailableFromElement
protected boolean isKeyAvailableFromElement()CollectionTableMapContainerPolicy is for mappings where the key is stored in a table separately from the map element.- Overrides:
isKeyAvailableFromElement
in classMapContainerPolicy
-
isMappedKeyMapPolicy
public boolean isMappedKeyMapPolicy()- Overrides:
isMappedKeyMapPolicy
in classContainerPolicy
-
isMapKeyAttribute
public boolean isMapKeyAttribute()INTERNAL: Return whether a map key this container policy represents is an attribute By default this method will return false since only subclasses actually represent maps.- Overrides:
isMapKeyAttribute
in classMapContainerPolicy
-
isMapKeyObject
public boolean isMapKeyObject()INTERNAL: Return if the map key this container policy represents is a OneToOne.- Overrides:
isMapKeyObject
in classContainerPolicy
-
iterateOnMapKey
INTERNAL: Used in Descriptor Iteration to iterate on map keys.- Overrides:
iterateOnMapKey
in classContainerPolicy
-
postCalculateChanges
public void postCalculateChanges(ObjectChangeSet ocs, ClassDescriptor referenceDescriptor, DatabaseMapping mapping, UnitOfWorkImpl uow) INTERNAL: Add the provided object to the deleted objects list on the commit manager. This may be overridden by subclasses to process a composite object.- Overrides:
postCalculateChanges
in classContainerPolicy
- See Also:
-
postCalculateChanges
public void postCalculateChanges(Object key, Object value, ClassDescriptor referenceDescriptor, DatabaseMapping mapping, UnitOfWorkImpl uow) INTERNAL: Add the provided object to the deleted objects list on the commit manager. This may be overridden by subclasses to process a composite object.- Overrides:
postCalculateChanges
in classContainerPolicy
-
processAdditionalWritableMapKeyFields
INTERNAL: This method is used to check the key mapping to ensure that it does not write to a field that is written by another mapping. There are two possibilities: 1. The conflicting mapping has already been processed. In that case, we add MultipleWritableMappings exception to the integrity checker right away 2. There are no conflicting mappings. In that case, we store the list of fields that this mapping has processed on the descriptor for the target so they can be checked as the descriptor initializes.- Overrides:
processAdditionalWritableMapKeyFields
in classContainerPolicy
-
recordPrivateOwnedRemovals
public void recordPrivateOwnedRemovals(Object object, ClassDescriptor referenceDescriptor, UnitOfWorkImpl uow) INTERNAL: Add the key and value from provided association to the deleted objects list on the commit manager.- Overrides:
recordPrivateOwnedRemovals
in classContainerPolicy
-
requiresDataModificationEvents
public boolean requiresDataModificationEvents()INTERNAL: Returns whether this ContainerPolicy requires data modification events when objects are added or deleted during update.- Overrides:
requiresDataModificationEvents
in classContainerPolicy
-
keyFrom
INTERNAL: Return the key for the specified element.- Overrides:
keyFrom
in classMapContainerPolicy
-
postInitialize
INTERNAL: Some subclasses need to post initialize mappings associated with them.- Overrides:
postInitialize
in classContainerPolicy
-
propogatePostDelete
INTERNAL: Propagate the postDeleteEvent to any additional objects the query is aware of- Overrides:
propogatePostDelete
in classContainerPolicy
-
propogatePostInsert
INTERNAL: Propagate the postDeleteEvent to any additional objects the query is aware of- Overrides:
propogatePostInsert
in classContainerPolicy
-
propogatePostUpdate
INTERNAL: Propagate the postDeleteEvent to any additional objects the query is aware of- Overrides:
propogatePostUpdate
in classContainerPolicy
-
propogatePreDelete
INTERNAL: Propagate the postDeleteEvent to any additional objects the query is aware of- Overrides:
propogatePreDelete
in classContainerPolicy
-
propogatePreInsert
INTERNAL: Propagate the postDeleteEvent to any additional objects the query is aware of- Overrides:
propogatePreInsert
in classContainerPolicy
-
propogatePreUpdate
INTERNAL: Propagate the postDeleteEvent to any additional objects the query is aware of- Overrides:
propogatePreUpdate
in classContainerPolicy
-
propagatesEventsToCollection
public boolean propagatesEventsToCollection()INTERNAL: Returns true if the key mapping is an AggregateObjectMapping. Aggregates need events propagated to them because they are not explicitly deleted, updated or inserted- Overrides:
propagatesEventsToCollection
in classContainerPolicy
-
setKeyField
INTERNAL: Set the DatabaseField that will represent the key in a DirectMapMapping. -
setDescriptorForKeyMapping
INTERNAL: Used during initialization of DirectMapMapping. Sets the descriptor associated with the key. -
setKeyConverter
INTERNAL: Set a converter on the KeyField of a DirectCollectionMapping. -
setKeyConverterClassName
INTERNAL: Set the name of the class to be used as a converter for the key of a DirectMapMaping. -
setKeyMapping
-
setKeyQuery
INTERNAL: Some map keys must be obtained from the database. This query is used to obtain the key -
setValueMapping
-
shouldIncludeKeyInDeleteEvent
public boolean shouldIncludeKeyInDeleteEvent()INTERNAL: Return whether data for a map key must be included on a Delete datamodification event If the keyMapping is privateOwned, that data should be.- Overrides:
shouldIncludeKeyInDeleteEvent
in classContainerPolicy
-
shouldUpdateForeignKeysPostInsert
public boolean shouldUpdateForeignKeysPostInsert()INTERNAL: Certain types of container policies require an extra update statement after a relationship is inserted. Return whether this update statement is required.- Overrides:
shouldUpdateForeignKeysPostInsert
in classContainerPolicy
-
updateJoinedMappingIndexesForMapKey
INTERNAL: Update the joined mapping indices Adds the key mapping and it's index to the list of joined mappings.- Overrides:
updateJoinedMappingIndexesForMapKey
in classContainerPolicy
-
unwrapKey
INTERNAL: Allow the key to be unwrapped. This will be overridden by container policies that allow keys that are entities.- Overrides:
unwrapKey
in classMapContainerPolicy
-
valueFromPKList
public Object valueFromPKList(Object[] pks, AbstractRecord foreignKeys, ForeignReferenceMapping mapping, AbstractSession session) INTERNAL: This method is used to load a relationship from a list of PKs. This list may be available if the relationship has been cached.- Overrides:
valueFromPKList
in classMapContainerPolicy
-