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
FieldsFields inherited from class org.eclipse.persistence.internal.queries.MapContainerPolicy
elementClass, elementClassName, keyField, keyMethod, keyNameFields inherited from class org.eclipse.persistence.internal.queries.InterfaceContainerPolicy
cloneMethod, containerClass, containerClassNameFields inherited from class org.eclipse.persistence.internal.queries.ContainerPolicy
constructor, defaultContainerClass, elementDescriptor -
Constructor Summary
ConstructorsConstructorDescriptionINTERNAL: 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 TypeMethodDescriptionvoidaddAdditionalFieldsToQuery(ReadQuery selectionQuery, Expression baseExpression) INTERNAL: Called when the selection query is being initialize to add the fields for the key to the queryvoidaddFieldsForMapKey(AbstractRecord joinRow) INTERNAL: Called when the insert query is being initialized to ensure the fields for the key are in the insert querybooleanaddInto(Object element, Object container, AbstractSession session) INTERNAL: Add element into container which implements the Map interface.booleanaddInto(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.booleanaddInto(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 keyvoidaddNestedJoinsQueriesForMapKey(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.voidcascadeDiscoverAndPersistUnregisteredNewObjects(Object object, Map newObjects, Map unregisteredExistingObjects, Map visitedObjects, UnitOfWorkImpl uow, Set cascadeErrors) INTERNAL: Cascade discover and persist new objects during commit to the map keyvoidcascadePerformRemoveIfRequired(Object object, UnitOfWorkImpl uow, Map visitedObjects) INTERNAL: Cascade registerNew to any mappings managed by the container policy.voidcascadeRegisterNewIfRequired(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.booleancompareContainers(Object firstObjectMap, Object secondObjectMap) INTERNAL: Return true if keys are the same.booleancompareKeys(Object sourceValue, AbstractSession session) INTERNAL: Return true if keys are the same in the source as the backup.voidconvertClassNamesToClasses(ClassLoader classLoader) INTERNAL: Convert all the class-name-based settings in this ContainerPolicy to actual class-based settingsprotected voidcreateChangeSetForKeys(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.voiddeleteWrappedObject(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.voidinitialize(AbstractSession session, DatabaseTable keyTable) INTERNAL: Initialize the key mappingprotected booleanCollectionTableMapContainerPolicy is for mappings where the key is stored in a table separately from the map element.booleanINTERNAL: 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.booleanINTERNAL: Return if the map key this container policy represents is a OneToOne.booleanvoiditerateOnMapKey(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.voidpostCalculateChanges(Object key, Object value, ClassDescriptor referenceDescriptor, DatabaseMapping mapping, UnitOfWorkImpl uow) INTERNAL: Add the provided object to the deleted objects list on the commit manager.voidpostCalculateChanges(ObjectChangeSet ocs, ClassDescriptor referenceDescriptor, DatabaseMapping mapping, UnitOfWorkImpl uow) INTERNAL: Add the provided object to the deleted objects list on the commit manager.voidpostInitialize(AbstractSession session) INTERNAL: Some subclasses need to post initialize mappings associated with them.voidINTERNAL: 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.booleanINTERNAL: Returns true if the key mapping is an AggregateObjectMapping.voidpropogatePostDelete(DeleteObjectQuery query, Object object) INTERNAL: Propagate the postDeleteEvent to any additional objects the query is aware ofvoidpropogatePostInsert(WriteObjectQuery query, Object object) INTERNAL: Propagate the postDeleteEvent to any additional objects the query is aware ofvoidpropogatePostUpdate(WriteObjectQuery query, Object object) INTERNAL: Propagate the postDeleteEvent to any additional objects the query is aware ofvoidpropogatePreDelete(DeleteObjectQuery query, Object object) INTERNAL: Propagate the postDeleteEvent to any additional objects the query is aware ofvoidpropogatePreInsert(WriteObjectQuery query, Object object) INTERNAL: Propagate the postDeleteEvent to any additional objects the query is aware ofvoidpropogatePreUpdate(WriteObjectQuery query, Object object) INTERNAL: Propagate the postDeleteEvent to any additional objects the query is aware ofvoidrecordPrivateOwnedRemovals(Object object, ClassDescriptor referenceDescriptor, UnitOfWorkImpl uow) INTERNAL: Add the key and value from provided association to the deleted objects list on the commit manager.booleanINTERNAL: Returns whether this ContainerPolicy requires data modification events when objects are added or deleted during update.voidsetDescriptorForKeyMapping(ClassDescriptor descriptor) INTERNAL: Used during initialization of DirectMapMapping.voidsetKeyConverter(Converter keyConverter, DirectMapMapping mapping) INTERNAL: Set a converter on the KeyField of a DirectCollectionMapping.voidsetKeyConverterClassName(String keyConverterClassName, DirectMapMapping mapping) INTERNAL: Set the name of the class to be used as a converter for the key of a DirectMapMaping.voidsetKeyField(DatabaseField keyField, ClassDescriptor descriptor) INTERNAL: Set the DatabaseField that will represent the key in a DirectMapMapping.voidsetKeyMapping(MapKeyMapping mapping) voidsetKeyQuery(DatabaseQuery keyQuery) INTERNAL: Some map keys must be obtained from the database.voidsetValueMapping(MapComponentMapping mapping) booleanINTERNAL: Return whether data for a map key must be included on a Delete datamodification event If the keyMapping is privateOwned, that data should be.booleanINTERNAL: 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.intupdateJoinedMappingIndexesForMapKey(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, unwrapIteratorResultMethods inherited from class org.eclipse.persistence.internal.queries.InterfaceContainerPolicy
buildContainerFromVector, equals, getCloneMethod, getCloneMethod, getContainerClass, getContainerClassName, hashCode, invokeCloneMethodOn, isValidContainerType, setCloneMethod, setContainerClass, setContainerClassName, toStringInfoMethods 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, vectorForMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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:
addAdditionalFieldsToQueryin 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:
getKeyMappingDataForWriteQueryin classContainerPolicy
-
getKeyType
INTERNAL: Return the type of the map key, this will be overridden by container policies that allow maps.- Overrides:
getKeyTypein classMapContainerPolicy
-
addFieldsForMapKey
INTERNAL: Called when the insert query is being initialized to ensure the fields for the key are in the insert query- Overrides:
addFieldsForMapKeyin 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:
addIntoin interfaceCoreContainerPolicy<AbstractSession>- Overrides:
addIntoin 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:
addIntoin 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:
addIntoin 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:
addNestedJoinsQueriesForMapKeyin 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:
buildCloneForKeyin classContainerPolicy
-
buildSelectionQueryForDirectCollectionMapping
INTERNAL: Certain key mappings favor different types of selection query. Return the appropriate type of selectionQuery.- Overrides:
buildSelectionQueryForDirectCollectionMappingin 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:
buildKeyin 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:
buildKeyFromJoinedRowin 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:
buildReferencesPKListin 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:
cascadeDiscoverAndPersistUnregisteredNewObjectsin classContainerPolicy
-
cascadePerformRemoveIfRequired
INTERNAL: Cascade registerNew to any mappings managed by the container policy. This will cascade the register to the key mapping.- Overrides:
cascadePerformRemoveIfRequiredin classContainerPolicy
-
cascadeRegisterNewIfRequired
INTERNAL: Cascade registerNew to any mappings managed by the container policy. This will cascade the register to the key mapping.- Overrides:
cascadeRegisterNewIfRequiredin classContainerPolicy
-
clone
INTERNAL: The mapping clones itself to create deep copy.- Overrides:
clonein 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:
compareKeysin classMapContainerPolicy
-
createChangeSetForKeys
protected void createChangeSetForKeys(Map originalKeyValues, CollectionChangeRecord changeRecord, AbstractSession session, ClassDescriptor referenceDescriptor) INTERNAL: Create change sets that contain map keys.- Overrides:
createChangeSetForKeysin classContainerPolicy
-
createQueryKeyForMapKey
INTERNAL: Create a query key that links to the map key.- Overrides:
createQueryKeyForMapKeyin 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:
createWrappedObjectFromExistingWrappedObjectin 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:
convertClassNamesToClassesin classMapContainerPolicy
-
deleteWrappedObject
INTERNAL: Delete the key and value of the passed association passed object.- Overrides:
deleteWrappedObjectin classContainerPolicy- See Also:
-
getAdditionalTablesForJoinQuery
INTERNAL: Return any tables that will be required when this mapping is used as part of a join query.- Overrides:
getAdditionalTablesForJoinQueryin classContainerPolicy
-
getAdditionalFieldsForJoin
INTERNAL: Return any additional fields required by the policy for a fetch join.- Overrides:
getAdditionalFieldsForJoinin 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:
getDescriptorForMapKeyin 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:
getCloneDataFromChangeSetin 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:
getDirectKeyFieldin 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:
getIdentityFieldsForMapKeyin 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:
getKeySelectionCriteriain classContainerPolicy
-
getValueMapping
-
initialize
INTERNAL: Initialize the key mapping- Overrides:
initializein classContainerPolicy
-
isKeyAvailableFromElement
protected boolean isKeyAvailableFromElement()CollectionTableMapContainerPolicy is for mappings where the key is stored in a table separately from the map element.- Overrides:
isKeyAvailableFromElementin classMapContainerPolicy
-
isMappedKeyMapPolicy
public boolean isMappedKeyMapPolicy()- Overrides:
isMappedKeyMapPolicyin 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:
isMapKeyAttributein classMapContainerPolicy
-
isMapKeyObject
public boolean isMapKeyObject()INTERNAL: Return if the map key this container policy represents is a OneToOne.- Overrides:
isMapKeyObjectin classContainerPolicy
-
iterateOnMapKey
INTERNAL: Used in Descriptor Iteration to iterate on map keys.- Overrides:
iterateOnMapKeyin 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:
postCalculateChangesin 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:
postCalculateChangesin 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:
processAdditionalWritableMapKeyFieldsin 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:
recordPrivateOwnedRemovalsin classContainerPolicy
-
requiresDataModificationEvents
public boolean requiresDataModificationEvents()INTERNAL: Returns whether this ContainerPolicy requires data modification events when objects are added or deleted during update.- Overrides:
requiresDataModificationEventsin classContainerPolicy
-
keyFrom
INTERNAL: Return the key for the specified element.- Overrides:
keyFromin classMapContainerPolicy
-
postInitialize
INTERNAL: Some subclasses need to post initialize mappings associated with them.- Overrides:
postInitializein classContainerPolicy
-
propogatePostDelete
INTERNAL: Propagate the postDeleteEvent to any additional objects the query is aware of- Overrides:
propogatePostDeletein classContainerPolicy
-
propogatePostInsert
INTERNAL: Propagate the postDeleteEvent to any additional objects the query is aware of- Overrides:
propogatePostInsertin classContainerPolicy
-
propogatePostUpdate
INTERNAL: Propagate the postDeleteEvent to any additional objects the query is aware of- Overrides:
propogatePostUpdatein classContainerPolicy
-
propogatePreDelete
INTERNAL: Propagate the postDeleteEvent to any additional objects the query is aware of- Overrides:
propogatePreDeletein classContainerPolicy
-
propogatePreInsert
INTERNAL: Propagate the postDeleteEvent to any additional objects the query is aware of- Overrides:
propogatePreInsertin classContainerPolicy
-
propogatePreUpdate
INTERNAL: Propagate the postDeleteEvent to any additional objects the query is aware of- Overrides:
propogatePreUpdatein 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:
propagatesEventsToCollectionin 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:
shouldIncludeKeyInDeleteEventin 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:
shouldUpdateForeignKeysPostInsertin classContainerPolicy
-
updateJoinedMappingIndexesForMapKey
INTERNAL: Update the joined mapping indices Adds the key mapping and it's index to the list of joined mappings.- Overrides:
updateJoinedMappingIndexesForMapKeyin classContainerPolicy
-
unwrapKey
INTERNAL: Allow the key to be unwrapped. This will be overridden by container policies that allow keys that are entities.- Overrides:
unwrapKeyin 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:
valueFromPKListin classMapContainerPolicy
-