MapKeyMapping is implemented by DatabaseMappings that can be used to map the key in a map
that uses a MappedKeyMapContainerPolicy. This interface provides the facilities to retreive data
for the key from the database, to get data from the object to put in the database, and to appropriately
initialize the mappings.

addAdditionalFieldsToQuery(ReadQuery selectionQuery,
Expression baseExpression)
INTERNAL:
Used when initializing queries for mappings that use a Map
Called when the selection query is being initialized to add the fields for the map key to the query

void

addFieldsForMapKey(org.eclipse.persistence.internal.sessions.AbstractRecord joinRow)
INTERNAL:
Used when initializing queries for mappings that use a Map
Called when the insert query is being initialized to ensure the fields for the map key are in the insert query

void

addKeyToDeletedObjectsList(java.lang.Object object,
java.util.Map deletedObjects)
INTERNAL:
For mappings used as MapKeys in MappedKeyContainerPolicy.

java.lang.Object

buildElementClone(java.lang.Object element,
java.lang.Object parent,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork,
boolean isExisting)
Build a clone of the given element in a unitOfWork

buildSelectionQueryForDirectCollectionKeyMapping(org.eclipse.persistence.internal.queries.ContainerPolicy containerPolicy)
INTERNAL:
Depending on the MapKeyMapping, a different selection query may be required to retrieve the
map when the map is based on a DirectCollectionMapping

createMapComponentFromJoinedRow(org.eclipse.persistence.internal.sessions.AbstractRecord dbRow,
org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager,
ObjectBuildingQuery query,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL
Called when a DatabaseMapping is used to map the key in a collection and a join query is used.

java.lang.Object

createMapComponentFromSerializableKeyInfo(java.lang.Object keyInfo,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
Create an instance of the Key object from the key information extracted from the map.

createSerializableMapKeyInfo(java.lang.Object key,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
Creates the Array of simple types used to recreate this map.

void

deleteMapKey(java.lang.Object objectDeleted,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
For mappings used as MapKeys in MappedKeyContainerPolicy, Delete the passed object if necessary.

java.util.Map

extractIdentityFieldsForQuery(java.lang.Object key,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
Extract the fields for the Map key from the object to use in a query

getNestedJoinQuery(org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager,
ObjectLevelReadQuery query,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
Return the query that is used when this mapping is part of a joined relationship

getTargetVersionOfSourceObject(java.lang.Object object,
java.lang.Object parent,
org.eclipse.persistence.internal.sessions.MergeManager mergeManager)
INTERNAL:
If required, get the targetVersion of the source object from the merge manager

void

iterateOnMapKey(org.eclipse.persistence.internal.descriptors.DescriptorIterator iterator,
java.lang.Object element)
INTERNAL:
Called when iterating through descriptors to handle iteration on this mapping when it is used as a MapKey

void

postInitializeMapKey(org.eclipse.persistence.internal.queries.MappedKeyMapContainerPolicy policy)
INTERNAL:
Making any mapping changes necessary to use a the mapping as a map key after initializing the mapping

void

preinitializeMapKey(org.eclipse.persistence.internal.helper.DatabaseTable table)
INTERNAL:
Making any mapping changes necessary to use a the mapping as a map key prior to initializing the mapping

addKeyToDeletedObjectsList

INTERNAL:
For mappings used as MapKeys in MappedKeyContainerPolicy. Add the target of this mapping to the deleted
objects list if necessary
This method is used for removal of private owned relationships

createMapComponentFromSerializableKeyInfo

INTERNAL:
Create an instance of the Key object from the key information extracted from the map.
This may return the value directly in case of a simple key or will be used as the FK to load a related entity.

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

requiresDataModificationEventsForMapKey

boolean requiresDataModificationEventsForMapKey()

INTERNAL:
Return whether this mapping requires extra queries to update the rows if it is
used as a key in a map. This will typically be true if there are any parts to this mapping
that are not read-only.