|
EclipseLink 2.0.0, build 'v20091127-r5931' API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MapKeyMapping
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.
MappedKeyMapContainerPolicy
,
AbstractDirectMapping
,
AggregateObjectMapping
,
OneToOneMapping
Method Summary | |
---|---|
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(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 |
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(java.lang.Object object,
java.util.Map newObjects,
java.util.Map unregisteredExistingObjects,
java.util.Map visitedObjects,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow,
boolean getAttributeValueFromObject)
INTERNAL: Cascade discover and persist new objects during commit to the map key |
void |
cascadePerformRemoveIfRequired(java.lang.Object object,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow,
java.util.Map visitedObjects,
boolean getAttributeValueFromObject)
INTERNAL: Cascade perform delete through mappings that require the cascade |
void |
cascadeRegisterNewIfRequired(java.lang.Object object,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow,
java.util.Map visitedObjects,
boolean getAttributeValueFromObject)
INTERNAL: Cascade registerNew for Create through mappings that require the cascade |
java.lang.Object |
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. |
QueryKey |
createQueryKeyForMapKey()
INTERNAL: Create a query key that links to the map key |
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 |
Expression |
getAdditionalSelectionCriteriaForMapKey()
INTERNAL: Return the selection criteria necessary to select the target object |
java.util.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 |
java.util.List<org.eclipse.persistence.internal.helper.DatabaseField> |
getAllFieldsForMapKey()
INTERNAL: Get all the fields for the map key |
java.util.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 |
java.util.List<org.eclipse.persistence.internal.helper.DatabaseField> |
getIdentityFieldsForMapKey()
INTERNAL: Return the fields that make up the identity of the mapped object. |
java.lang.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 |
java.lang.Object |
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 |
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 |
java.lang.Object |
unwrapKey(java.lang.Object key,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Allow the key mapping to unwrap the object |
java.lang.Object |
wrapKey(java.lang.Object key,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Allow the key mapping to wrap the object |
Methods inherited from interface org.eclipse.persistence.mappings.foundation.MapComponentMapping |
---|
createMapComponentFromRow |
Method Detail |
---|
void addAdditionalFieldsToQuery(ReadQuery selectionQuery, Expression baseExpression)
void addFieldsForMapKey(org.eclipse.persistence.internal.sessions.AbstractRecord joinRow)
void addKeyToDeletedObjectsList(java.lang.Object object, java.util.Map deletedObjects)
object
- manager
- java.lang.Object buildElementClone(java.lang.Object element, java.lang.Object parent, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork, boolean isExisting)
element
- unitOfWork
- isExisting
-
ReadQuery buildSelectionQueryForDirectCollectionKeyMapping(org.eclipse.persistence.internal.queries.ContainerPolicy containerPolicy)
void cascadeDiscoverAndPersistUnregisteredNewObjects(java.lang.Object object, java.util.Map newObjects, java.util.Map unregisteredExistingObjects, java.util.Map visitedObjects, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, boolean getAttributeValueFromObject)
void cascadePerformRemoveIfRequired(java.lang.Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, java.util.Map visitedObjects, boolean getAttributeValueFromObject)
void cascadeRegisterNewIfRequired(java.lang.Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, java.util.Map visitedObjects, boolean getAttributeValueFromObject)
java.lang.Object createMapComponentFromJoinedRow(org.eclipse.persistence.internal.sessions.AbstractRecord dbRow, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, ObjectBuildingQuery query, org.eclipse.persistence.internal.sessions.AbstractSession session)
QueryKey createQueryKeyForMapKey()
void deleteMapKey(java.lang.Object objectDeleted, org.eclipse.persistence.internal.sessions.AbstractSession session)
objectDeleted
- session
- java.util.List<org.eclipse.persistence.internal.helper.DatabaseTable> getAdditionalTablesForJoinQuery()
java.util.List<org.eclipse.persistence.internal.helper.DatabaseField> getAllFieldsForMapKey()
java.util.Map<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> getForeignKeyFieldsForMapKey()
ClassDescriptor getReferenceDescriptor()
java.util.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()
java.lang.Object getTargetVersionOfSourceObject(java.lang.Object object, java.lang.Object parent, org.eclipse.persistence.internal.sessions.MergeManager mergeManager)
java.lang.Object getMapKeyTargetType()
void iterateOnMapKey(org.eclipse.persistence.internal.descriptors.DescriptorIterator iterator, java.lang.Object element)
iterator
- element
- java.util.Map extractIdentityFieldsForQuery(java.lang.Object key, org.eclipse.persistence.internal.sessions.AbstractSession session)
void preinitializeMapKey(org.eclipse.persistence.internal.helper.DatabaseTable table) throws DescriptorException
DescriptorException
java.lang.Object unwrapKey(java.lang.Object key, org.eclipse.persistence.internal.sessions.AbstractSession session)
key
- session
-
java.lang.Object wrapKey(java.lang.Object key, org.eclipse.persistence.internal.sessions.AbstractSession session)
key
- session
-
|
EclipseLink 2.0.0, build 'v20091127-r5931' API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |