public interface MapKeyMapping extends MapComponentMapping
MappedKeyMapContainerPolicy
,
AbstractDirectMapping
,
AggregateObjectMapping
,
OneToOneMapping
Modifier and Type | Method and Description |
---|---|
void |
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(Object object,
Map deletedObjects)
INTERNAL:
For mappings used as MapKeys in MappedKeyContainerPolicy.
|
Object |
buildElementClone(Object element,
Object parent,
org.eclipse.persistence.internal.identitymaps.CacheKey cacheKey,
Integer refreshCascade,
org.eclipse.persistence.internal.sessions.AbstractSession cloningSession,
boolean isExisting,
boolean isFromSharedCache)
Build a clone of the given element in a unitOfWork
|
ReadQuery |
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
|
void |
cascadeDiscoverAndPersistUnregisteredNewObjects(Object object,
Map newObjects,
Map unregisteredExistingObjects,
Map visitedObjects,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow,
boolean getAttributeValueFromObject,
Set cascadeErrors)
INTERNAL:
Cascade discover and persist new objects during commit to the map key
|
void |
cascadePerformRemoveIfRequired(Object object,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow,
Map visitedObjects,
boolean getAttributeValueFromObject)
INTERNAL:
Cascade perform delete through mappings that require the cascade
|
void |
cascadeRegisterNewIfRequired(Object object,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow,
Map visitedObjects,
boolean getAttributeValueFromObject)
INTERNAL:
Cascade registerNew for Create through mappings that require the cascade
|
Object |
createMapComponentFromJoinedRow(org.eclipse.persistence.internal.sessions.AbstractRecord dbRow,
org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager,
ObjectBuildingQuery query,
org.eclipse.persistence.internal.identitymaps.CacheKey parentCacheKey,
org.eclipse.persistence.internal.sessions.AbstractSession session,
boolean isTargetProtected)
INTERNAL
Called when a DatabaseMapping is used to map the key in a collection and a join query is used.
|
List<Object> |
createMapComponentsFromSerializableKeyInfo(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.
|
QueryKey |
createQueryKeyForMapKey()
INTERNAL:
Create a query key that links to the map key
|
Object |
createSerializableMapKeyInfo(Object key,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
Creates the Array of simple types used to recreate this map.
|
Object |
createStubbedMapComponentFromSerializableKeyInfo(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.
|
void |
deleteMapKey(Object objectDeleted,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
For mappings used as MapKeys in MappedKeyContainerPolicy, Delete the passed object if necessary.
|
Map |
extractIdentityFieldsForQuery(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
|
Expression |
getAdditionalSelectionCriteriaForMapKey()
INTERNAL:
Return the selection criteria necessary to select the target object
|
List<org.eclipse.persistence.internal.helper.DatabaseTable> |
getAdditionalTablesForJoinQuery()
INTERNAL:
Return any tables that will be required when this mapping is used as part of a join query
|
List<org.eclipse.persistence.internal.helper.DatabaseField> |
getAllFieldsForMapKey()
INTERNAL:
Get all the fields for the map key
|
Map<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> |
getForeignKeyFieldsForMapKey()
INTERNAL:
Return a Map of any foreign keys defined within the the MapKey
|
List<org.eclipse.persistence.internal.helper.DatabaseField> |
getIdentityFieldsForMapKey()
INTERNAL:
Return the fields that make up the identity of the mapped object.
|
Object |
getMapKeyTargetType()
INTERNAL:
Return the class this key mapping maps or the descriptor for it
|
ObjectLevelReadQuery |
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
|
ClassDescriptor |
getReferenceDescriptor()
INTERNAL:
Get the descriptor for the Map Key
|
Object |
getTargetVersionOfSourceObject(Object object,
Object parent,
org.eclipse.persistence.internal.sessions.MergeManager mergeManager,
org.eclipse.persistence.internal.sessions.AbstractSession targetSession)
INTERNAL:
If required, get the targetVersion of the source object from the merge manager
|
void |
iterateOnMapKey(org.eclipse.persistence.internal.descriptors.DescriptorIterator iterator,
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
|
boolean |
requiresDataModificationEventsForMapKey()
INTERNAL:
Return whether this mapping requires extra queries to update the rows if it is
used as a key in a map.
|
Object |
unwrapKey(Object key,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
Allow the key mapping to unwrap the object
|
Object |
wrapKey(Object key,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
Allow the key mapping to wrap the object
|
clone, createMapComponentFromRow
void addAdditionalFieldsToQuery(ReadQuery selectionQuery, Expression baseExpression)
void addFieldsForMapKey(org.eclipse.persistence.internal.sessions.AbstractRecord joinRow)
void addKeyToDeletedObjectsList(Object object, Map deletedObjects)
object
- deletedObjects
- Object buildElementClone(Object element, Object parent, org.eclipse.persistence.internal.identitymaps.CacheKey cacheKey, Integer refreshCascade, org.eclipse.persistence.internal.sessions.AbstractSession cloningSession, boolean isExisting, boolean isFromSharedCache)
element
- cloningSession
- isExisting
- ReadQuery buildSelectionQueryForDirectCollectionKeyMapping(org.eclipse.persistence.internal.queries.ContainerPolicy containerPolicy)
void cascadeDiscoverAndPersistUnregisteredNewObjects(Object object, Map newObjects, Map unregisteredExistingObjects, Map visitedObjects, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, boolean getAttributeValueFromObject, Set cascadeErrors)
void cascadePerformRemoveIfRequired(Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, Map visitedObjects, boolean getAttributeValueFromObject)
void cascadeRegisterNewIfRequired(Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, Map visitedObjects, boolean getAttributeValueFromObject)
Object createMapComponentFromJoinedRow(org.eclipse.persistence.internal.sessions.AbstractRecord dbRow, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, ObjectBuildingQuery query, org.eclipse.persistence.internal.identitymaps.CacheKey parentCacheKey, org.eclipse.persistence.internal.sessions.AbstractSession session, boolean isTargetProtected)
QueryKey createQueryKeyForMapKey()
Object createSerializableMapKeyInfo(Object key, org.eclipse.persistence.internal.sessions.AbstractSession session)
List<Object> createMapComponentsFromSerializableKeyInfo(Object[] keyInfo, org.eclipse.persistence.internal.sessions.AbstractSession session)
Object createStubbedMapComponentFromSerializableKeyInfo(Object keyInfo, org.eclipse.persistence.internal.sessions.AbstractSession session)
void deleteMapKey(Object objectDeleted, org.eclipse.persistence.internal.sessions.AbstractSession session)
objectDeleted
- session
- List<org.eclipse.persistence.internal.helper.DatabaseTable> getAdditionalTablesForJoinQuery()
List<org.eclipse.persistence.internal.helper.DatabaseField> getAllFieldsForMapKey()
Map<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> getForeignKeyFieldsForMapKey()
ClassDescriptor getReferenceDescriptor()
List<org.eclipse.persistence.internal.helper.DatabaseField> getIdentityFieldsForMapKey()
ObjectLevelReadQuery getNestedJoinQuery(org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, ObjectLevelReadQuery query, org.eclipse.persistence.internal.sessions.AbstractSession session)
Expression getAdditionalSelectionCriteriaForMapKey()
Object getTargetVersionOfSourceObject(Object object, Object parent, org.eclipse.persistence.internal.sessions.MergeManager mergeManager, org.eclipse.persistence.internal.sessions.AbstractSession targetSession)
Object getMapKeyTargetType()
void iterateOnMapKey(org.eclipse.persistence.internal.descriptors.DescriptorIterator iterator, Object element)
iterator
- element
- Map extractIdentityFieldsForQuery(Object key, org.eclipse.persistence.internal.sessions.AbstractSession session)
void preinitializeMapKey(org.eclipse.persistence.internal.helper.DatabaseTable table) throws DescriptorException
DescriptorException
void postInitializeMapKey(org.eclipse.persistence.internal.queries.MappedKeyMapContainerPolicy policy) throws DescriptorException
DescriptorException
boolean requiresDataModificationEventsForMapKey()
Object unwrapKey(Object key, org.eclipse.persistence.internal.sessions.AbstractSession session)
key
- session
- Copyright © 2007–2020 Eclipse.org - EclipseLink Project. All rights reserved.