Class MapContainerPolicy
- java.lang.Object
-
- org.eclipse.persistence.internal.queries.ContainerPolicy
-
- org.eclipse.persistence.internal.queries.InterfaceContainerPolicy
-
- org.eclipse.persistence.internal.queries.MapContainerPolicy
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,CoreContainerPolicy<AbstractSession>
- Direct Known Subclasses:
MappedKeyMapContainerPolicy
public class MapContainerPolicy extends InterfaceContainerPolicy
Purpose: A MapContainerPolicy is ContainerPolicy whose container class implements the Map interface.
Responsibilities: Provide the functionality to operate on an instance of a Map.
- See Also:
ContainerPolicy
,CollectionContainerPolicy
, Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MapContainerPolicy.MapContainerPolicyIterator
INTERNAL: This inner class is used to iterate through the Map.Entry s of a Map.
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Class
elementClass
protected java.lang.String
elementClassName
protected java.lang.reflect.Field
keyField
protected java.lang.reflect.Method
keyMethod
protected java.lang.String
keyName
The Method which is called on each value added to the Map and whose result is used as key to the value.-
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
Constructors Constructor Description MapContainerPolicy()
INTERNAL: Construct a new policy.MapContainerPolicy(java.lang.Class containerClass)
INTERNAL: Construct a new policy for the specified class.MapContainerPolicy(java.lang.String containerClassName)
INTERNAL: Construct a new policy for the specified class name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addInto(java.lang.Object key, java.lang.Object element, java.lang.Object container, AbstractSession session)
INTERNAL: Add element into container which implements the Map interface.boolean
addInto(java.lang.Object element, java.lang.Object container, AbstractSession session)
INTERNAL: Add element to container.void
addNextValueFromIteratorInto(java.lang.Object valuesIterator, java.lang.Object parent, CacheKey parentCacheKey, java.lang.Object toCollection, CollectionMapping mapping, java.lang.Integer refreshCascade, AbstractSession cloningSession, boolean isExisting, boolean isFromSharedCache)
INTERNAL: This method is used to add the next value from an iterator built using ContainerPolicy's iteratorFor() method into the toCollection.void
buildChangeSetForNewObjectInCollection(java.lang.Object object, ClassDescriptor referenceDescriptor, UnitOfWorkChangeSet uowChangeSet, AbstractSession session)
INTERNAL: Ensure the new key is set for the change set for a new map objectprotected java.lang.Object
buildCloneForValue(java.lang.Object value, java.lang.Object parent, CacheKey parentCacheKey, CollectionMapping mapping, java.lang.Integer refreshCascade, AbstractSession cloningSession, boolean isExisting, boolean isFromSharedCache)
Build a clone for the value in a mapping.java.lang.Object
buildCollectionEntry(java.lang.Object objectAdded, ObjectChangeSet changeSet)
INTERNAL: Return an object representing an entry in the collection represented by this container policy This method will returns an Association containing the key and the value for a Mapjava.lang.Object[]
buildReferencesPKList(java.lang.Object container, AbstractSession session)
INTERNAL: This method will access the target relationship and create a list of information to rebuild the collection.void
clear(java.lang.Object container)
INTERNAL: Remove all the elements from container.java.lang.Object
cloneFor(java.lang.Object container)
INTERNAL: Return a clone of the specified container.boolean
compareKeys(java.lang.Object sourceValue, AbstractSession session)
INTERNAL: Return true if keys are the same in the source as the backup.java.lang.Object
concatenateContainers(java.lang.Object firstContainer, java.lang.Object secondContainer, AbstractSession session)
INTERNAL: Build a new container, add the contents of each of the specified containers to it, and return it.protected boolean
contains(java.lang.Object element, java.lang.Object container)
INTERNAL: Return the true if element exists in container.void
convertClassNamesToClasses(java.lang.ClassLoader classLoader)
INTERNAL: Convert all the class-name-based settings in this ContainerPolicy to actual class-based settings.CollectionChangeEvent
createChangeEvent(java.lang.Object collectionOwner, java.lang.String propertyName, java.lang.Object collectionChanged, java.lang.Object elementChanged, int changeType, java.lang.Integer index, boolean isChangeApplied)
INTERNAL: Creates a CollectionChangeEvent for the containerQueryKey
createQueryKeyForMapKey()
INTERNAL: Create a query key that links to the map key.java.lang.Object
createWrappedObjectFromExistingWrappedObject(java.lang.Object wrappedObject, java.lang.Object parent, ClassDescriptor referenceDescriptor, MergeManager mergeManager, AbstractSession targetSession)
INTERNAL: This method will actually potentially wrap an object in two ways.DatabaseField
getDirectKeyField(CollectionMapping baseMapping)
INTERNAL: Return the DatabaseField that represents the key in a DirectMapMapping.java.lang.Class
getElementClass()
INTERNAL: Returns the element class which defines the map key.java.lang.String
getElementClassName()
INTERNAL: Returns the element class name which defines the map key.java.lang.Class
getInterfaceType()
INTERNAL:java.lang.String
getKeyName()
INTERNAL: Returns the key name which will return the value of the key to be used in the container.java.lang.Object
getKeyType()
INTERNAL: Return the type of the map key, this will be overridden by container policies that allow maps.boolean
hasNext(java.lang.Object iterator)
INTERNAL: Return whether the iterator has more objects.protected void
initializeKey()
INTERNAL: Set the keyMethod or keyField based on the keyName.protected boolean
isKeyAvailableFromElement()
MapContainerPolicy is for mappings where the key is stored in actual element.boolean
isMapKeyAttribute()
INTERNAL: Return whether a map key this container policy represents is an attribute.boolean
isMapPolicy()
INTERNAL Yes this is a MapPolicyboolean
isValidContainer(java.lang.Object container)
INTERNAL: Validate the container type.java.lang.Object
iteratorFor(java.lang.Object container)
INTERNAL: Return an Iterator for the given container.java.lang.Object
keyFrom(java.lang.Object element, AbstractSession session)
INTERNAL: Return the key for the specified element.java.lang.Object
keyFromEntry(java.lang.Object entry)
Get the key from the passed in Map.Entry.java.lang.Object
keyFromIterator(java.lang.Object iterator)
protected java.lang.Object
next(java.lang.Object iterator)
INTERNAL: Return the next object on the queue.java.lang.Object
nextEntry(java.lang.Object iterator)
INTERNAL: Return the next object on the queue.java.lang.Object
nextEntry(java.lang.Object iterator, AbstractSession session)
INTERNAL: Return the next object on the queue.void
prepare(DatabaseQuery query, AbstractSession session)
Prepare and validate.void
recordUpdateToCollectionInChangeRecord(CollectionChangeEvent event, ObjectChangeSet changeSet, CollectionChangeRecord collectionChangeRecord)
This method is used to bridge the behavior between Attribute Change Tracking and deferred change tracking with respect to adding the same instance multiple times.boolean
removeFrom(java.lang.Object key, java.lang.Object element, java.lang.Object container, AbstractSession session)
INTERNAL: Remove element from container which implements the Map interface.void
setElementClass(java.lang.Class elementClass)
INTERNAL: Sets the element class which defines the method.void
setKeyMethod(java.lang.String keyMethodName, java.lang.Class elementClass)
INTERNAL: Sets the Method to be used to generate the key in a Map type container class.void
setKeyMethod(java.lang.String keyMethodName, java.lang.String elementClassName)
INTERNAL: Sets the Method to be used to generate the key in a Map type container class.void
setKeyMethodName(java.lang.String keyMethodName)
INTERNAL: Sets the Method to be used to generate the key in a Map type container class.void
setKeyName(java.lang.String keyName)
INTERNAL: Sets the key name to be used to generate the key in a Map type container class.void
setKeyName(java.lang.String keyName, java.lang.Class elementClass)
INTERNAL: Sets the key name to be used to generate the key in a Map type container class.void
setKeyName(java.lang.String keyName, java.lang.String elementClassName)
INTERNAL: Sets the key name to be used to generate the key in a Map type container class.int
sizeFor(java.lang.Object container)
INTERNAL: Return the size of container.java.lang.Object
unwrapElement(java.lang.Object object)
INTERNAL: MapContainerPolicy's iterator iterates on the Entries of a Map.java.lang.Object
unwrapIteratorResult(java.lang.Object object)
INTERNAL: MapContainerPolicy's iterator iterates on the Entries of a Map.java.lang.Object
unwrapKey(java.lang.Object key, AbstractSession session)
INTERNAL: Allow the key to be unwrapped.java.lang.Object
valueFromPKList(java.lang.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.InterfaceContainerPolicy
buildContainerFromVector, equals, getCloneMethod, getCloneMethod, getContainerClass, getContainerClassName, hashCode, invokeCloneMethodOn, isValidContainerType, setCloneMethod, setContainerClass, setContainerClassName, toStringInfo
-
Methods inherited from class org.eclipse.persistence.internal.queries.ContainerPolicy
addAdditionalFieldsToQuery, addAll, addAll, addFieldsForMapKey, addInto, addInto, addNestedJoinsQueriesForMapKey, buildCloneForKey, buildDefaultPolicy, buildKey, buildKeyFromJoinedRow, buildPolicyFor, buildPolicyFor, buildSelectionQueryForDirectCollectionMapping, cascadeDiscoverAndPersistUnregisteredNewObjects, cascadePerformRemoveIfRequired, cascadeRegisterNewIfRequired, clone, clone, collectObjectForNewCollection, compareCollectionsForChange, containerInstance, containerInstance, contains, copyMapDataToRow, createChangeSetForKeys, deleteWrappedObject, execute, getAdditionalFieldsForJoin, getAdditionalTablesForJoinQuery, getChangeValuesFrom, getCloneDataFromChangeSet, getConstructor, getDefaultContainerClass, getDescriptorForMapKey, getElementDescriptor, getIdentityFieldsForMapKey, getKeyMappingDataForWriteQuery, getKeySelectionCriteria, hasElementDescriptor, hasOrder, initialize, initializeConstructor, isCollectionPolicy, isCursoredStreamPolicy, isCursorPolicy, isDirectMapPolicy, isEmpty, isListPolicy, isMapKeyObject, isMappedKeyMapPolicy, isOrderedListPolicy, isScrollableCursorPolicy, iterateOnMapKey, mergeCascadeParts, mergeChanges, mergeChanges, next, overridesRead, postCalculateChanges, postCalculateChanges, postInitialize, prepareForExecution, processAdditionalWritableMapKeyFields, propagatesEventsToCollection, propogatePostDelete, propogatePostInsert, propogatePostUpdate, propogatePreDelete, propogatePreInsert, propogatePreUpdate, recordAddToCollectionInChangeRecord, recordPrivateOwnedRemovals, recordRemoveFromCollectionInChangeRecord, remoteExecute, removeFrom, removeFrom, requiresDataModificationEvents, setConstructor, setDefaultContainerClass, setElementDescriptor, shouldAddAll, shouldIncludeKeyInDeleteEvent, shouldUpdateForeignKeysPostInsert, toString, updateChangeRecordForSelfMerge, updateJoinedMappingIndexesForMapKey, vectorFor
-
-
-
-
Field Detail
-
keyName
protected java.lang.String keyName
The Method which is called on each value added to the Map and whose result is used as key to the value.
-
elementClassName
protected java.lang.String elementClassName
-
elementClass
protected java.lang.Class elementClass
-
keyField
protected transient java.lang.reflect.Field keyField
-
keyMethod
protected transient java.lang.reflect.Method keyMethod
-
-
Constructor Detail
-
MapContainerPolicy
public MapContainerPolicy()
INTERNAL: Construct a new policy.
-
MapContainerPolicy
public MapContainerPolicy(java.lang.Class containerClass)
INTERNAL: Construct a new policy for the specified class.
-
MapContainerPolicy
public MapContainerPolicy(java.lang.String containerClassName)
INTERNAL: Construct a new policy for the specified class name.
-
-
Method Detail
-
prepare
public void prepare(DatabaseQuery query, AbstractSession session) throws QueryException
Prepare and validate. Set the element class.- Overrides:
prepare
in classContainerPolicy
- Throws:
QueryException
-
addInto
public boolean addInto(java.lang.Object element, java.lang.Object container, AbstractSession session)
INTERNAL: Add element to container. This is used to add to a collection independent of the collection type. The session may be required to wrap for the wrapper policy. Return whether the container changed.- Specified by:
addInto
in interfaceCoreContainerPolicy<AbstractSession>
- Overrides:
addInto
in classContainerPolicy
-
addInto
public boolean addInto(java.lang.Object key, java.lang.Object element, java.lang.Object container, AbstractSession session)
INTERNAL: Add element into container which implements the Map interface.- Specified by:
addInto
in interfaceCoreContainerPolicy<AbstractSession>
- Overrides:
addInto
in classContainerPolicy
-
addNextValueFromIteratorInto
public void addNextValueFromIteratorInto(java.lang.Object valuesIterator, java.lang.Object parent, CacheKey parentCacheKey, java.lang.Object toCollection, CollectionMapping mapping, java.lang.Integer refreshCascade, AbstractSession cloningSession, boolean isExisting, boolean isFromSharedCache)
INTERNAL: This method is used to add the next value from an iterator built using ContainerPolicy's iteratorFor() method into the toCollection. Since this ContainerPolicy represents a Map, the key and the value are extracted and added.- Overrides:
addNextValueFromIteratorInto
in classContainerPolicy
- See Also:
MappedKeyMapContainerPolicy
-
buildCollectionEntry
public java.lang.Object buildCollectionEntry(java.lang.Object objectAdded, ObjectChangeSet changeSet)
INTERNAL: Return an object representing an entry in the collection represented by this container policy This method will returns an Association containing the key and the value for a Map- Overrides:
buildCollectionEntry
in classContainerPolicy
- Returns:
- See Also:
MappedKeyMapContainerPolicy
-
buildReferencesPKList
public java.lang.Object[] buildReferencesPKList(java.lang.Object container, AbstractSession session)
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 classContainerPolicy
- See Also:
ObjectReferenceMapping.buildReferencesPKList
,ContainerPolicy.buildReferencesPKList
-
buildChangeSetForNewObjectInCollection
public void buildChangeSetForNewObjectInCollection(java.lang.Object object, ClassDescriptor referenceDescriptor, UnitOfWorkChangeSet uowChangeSet, AbstractSession session)
INTERNAL: Ensure the new key is set for the change set for a new map object- Overrides:
buildChangeSetForNewObjectInCollection
in classContainerPolicy
-
buildCloneForValue
protected java.lang.Object buildCloneForValue(java.lang.Object value, java.lang.Object parent, CacheKey parentCacheKey, CollectionMapping mapping, java.lang.Integer refreshCascade, AbstractSession cloningSession, boolean isExisting, boolean isFromSharedCache)
Build a clone for the value in a mapping.
-
clear
public void clear(java.lang.Object container)
INTERNAL: Remove all the elements from container.- Specified by:
clear
in interfaceCoreContainerPolicy<AbstractSession>
- Overrides:
clear
in classContainerPolicy
-
cloneFor
public java.lang.Object cloneFor(java.lang.Object container)
INTERNAL: Return a clone of the specified container.- Overrides:
cloneFor
in classInterfaceContainerPolicy
-
compareKeys
public boolean compareKeys(java.lang.Object sourceValue, AbstractSession session)
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 classContainerPolicy
-
concatenateContainers
public java.lang.Object concatenateContainers(java.lang.Object firstContainer, java.lang.Object secondContainer, AbstractSession session)
INTERNAL: Build a new container, add the contents of each of the specified containers to it, and return it. Both of the containers must use the same container policy (namely, this one).- Overrides:
concatenateContainers
in classContainerPolicy
-
contains
protected boolean contains(java.lang.Object element, java.lang.Object container)
INTERNAL: Return the true if element exists in container.- Overrides:
contains
in classContainerPolicy
- Returns:
- boolean true if container 'contains' element
-
convertClassNamesToClasses
public void convertClassNamesToClasses(java.lang.ClassLoader classLoader)
INTERNAL: Convert all the class-name-based settings in this ContainerPolicy to actual class-based settings. This method is used when converting a project that has been built with class names to a project with classes.- Overrides:
convertClassNamesToClasses
in classInterfaceContainerPolicy
- Parameters:
classLoader
-
-
createChangeEvent
public CollectionChangeEvent createChangeEvent(java.lang.Object collectionOwner, java.lang.String propertyName, java.lang.Object collectionChanged, java.lang.Object elementChanged, int changeType, java.lang.Integer index, boolean isChangeApplied)
INTERNAL: Creates a CollectionChangeEvent for the container- Overrides:
createChangeEvent
in classInterfaceContainerPolicy
-
createQueryKeyForMapKey
public QueryKey createQueryKeyForMapKey()
INTERNAL: Create a query key that links to the map key. MapContainerPolicy does not have a specific mapping for the key, so return null.- Overrides:
createQueryKeyForMapKey
in classInterfaceContainerPolicy
-
createWrappedObjectFromExistingWrappedObject
public java.lang.Object createWrappedObjectFromExistingWrappedObject(java.lang.Object wrappedObject, java.lang.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 classContainerPolicy
parent
- if this is an aggregate, the owner of the aggregate- Returns:
- See Also:
MappedKeyMapContainerPolicy
-
getDirectKeyField
public DatabaseField getDirectKeyField(CollectionMapping baseMapping)
INTERNAL: Return the DatabaseField that represents the key in a DirectMapMapping. MapContainerPolicy gets it fields from the reference descriptor of the provided mappings. It uses its keyName to lookup the appropriate mapping and returns the field from that mapping.- Overrides:
getDirectKeyField
in classInterfaceContainerPolicy
-
getElementClass
public java.lang.Class getElementClass()
INTERNAL: Returns the element class which defines the map key.
-
getElementClassName
public java.lang.String getElementClassName()
INTERNAL: Returns the element class name which defines the map key.
-
getInterfaceType
public java.lang.Class getInterfaceType()
INTERNAL:- Specified by:
getInterfaceType
in classInterfaceContainerPolicy
-
getKeyName
public java.lang.String getKeyName()
INTERNAL: Returns the key name which will return the value of the key to be used in the container.
-
getKeyType
public java.lang.Object getKeyType()
INTERNAL: Return the type of the map key, this will be overridden by container policies that allow maps.- Overrides:
getKeyType
in classContainerPolicy
-
isMapPolicy
public boolean isMapPolicy()
INTERNAL Yes this is a MapPolicy- Overrides:
isMapPolicy
in classContainerPolicy
-
isKeyAvailableFromElement
protected boolean isKeyAvailableFromElement()
MapContainerPolicy is for mappings where the key is stored in actual element.
-
isMapKeyAttribute
public boolean isMapKeyAttribute()
INTERNAL: Return whether a map key this container policy represents is an attribute.- Overrides:
isMapKeyAttribute
in classInterfaceContainerPolicy
-
hasNext
public boolean hasNext(java.lang.Object iterator)
INTERNAL: Return whether the iterator has more objects. The iterator is the one returned from #iteratorFor().- Specified by:
hasNext
in interfaceCoreContainerPolicy<AbstractSession>
- Overrides:
hasNext
in classInterfaceContainerPolicy
- See Also:
ContainerPolicy.iteratorFor(java.lang.Object)
-
initializeKey
protected void initializeKey()
INTERNAL: Set the keyMethod or keyField based on the keyName.
-
iteratorFor
public java.lang.Object iteratorFor(java.lang.Object container)
INTERNAL: Return an Iterator for the given container.- Specified by:
iteratorFor
in interfaceCoreContainerPolicy<AbstractSession>
- Specified by:
iteratorFor
in classContainerPolicy
- See Also:
ContainerPolicy.hasNext(java.lang.Object)
,ContainerPolicy.next(java.lang.Object)
-
keyFrom
public java.lang.Object keyFrom(java.lang.Object element, AbstractSession session)
INTERNAL: Return the key for the specified element.- Overrides:
keyFrom
in classContainerPolicy
-
keyFromEntry
public java.lang.Object keyFromEntry(java.lang.Object entry)
Get the key from the passed in Map.Entry.- Overrides:
keyFromEntry
in classContainerPolicy
-
keyFromIterator
public java.lang.Object keyFromIterator(java.lang.Object iterator)
- Overrides:
keyFromIterator
in classContainerPolicy
-
next
protected java.lang.Object next(java.lang.Object iterator)
INTERNAL: Return the next object on the queue. The iterator is the one returned from #iteratorFor().- Overrides:
next
in classInterfaceContainerPolicy
- See Also:
ContainerPolicy.iteratorFor(java.lang.Object)
-
nextEntry
public java.lang.Object nextEntry(java.lang.Object iterator)
INTERNAL: Return the next object on the queue. The iterator is the one returned from #iteratorFor(). This will return a MapEntry to allow use of the key- Specified by:
nextEntry
in interfaceCoreContainerPolicy<AbstractSession>
- Overrides:
nextEntry
in classContainerPolicy
- See Also:
ContainerPolicy.iteratorFor(java.lang.Object)
-
nextEntry
public java.lang.Object nextEntry(java.lang.Object iterator, AbstractSession session)
INTERNAL: Return the next object on the queue. The iterator is the one returned from #iteratorFor(). This will return a MapEntry to allow use of the key- Specified by:
nextEntry
in interfaceCoreContainerPolicy<AbstractSession>
- Overrides:
nextEntry
in classContainerPolicy
- See Also:
ContainerPolicy#iteratorFor(Object iterator, AbstractSession session)
-
unwrapElement
public java.lang.Object unwrapElement(java.lang.Object object)
INTERNAL: MapContainerPolicy's iterator iterates on the Entries of a Map. This method returns the object from the iterator- Overrides:
unwrapElement
in classContainerPolicy
-
unwrapIteratorResult
public java.lang.Object unwrapIteratorResult(java.lang.Object object)
INTERNAL: MapContainerPolicy's iterator iterates on the Entries of a Map. This method returns the object from the iterator- Overrides:
unwrapIteratorResult
in classContainerPolicy
-
unwrapKey
public java.lang.Object unwrapKey(java.lang.Object key, AbstractSession session)
INTERNAL: Allow the key to be unwrapped. This will be overridden by container policies that allow keys that are entities.
-
recordUpdateToCollectionInChangeRecord
public void recordUpdateToCollectionInChangeRecord(CollectionChangeEvent event, ObjectChangeSet changeSet, CollectionChangeRecord collectionChangeRecord)
This method is used to bridge the behavior between Attribute Change Tracking and deferred change tracking with respect to adding the same instance multiple times. Each ContainerPolicy type will implement specific behavior for the collection type it is wrapping. These methods are only valid for collections containing object references- Overrides:
recordUpdateToCollectionInChangeRecord
in classContainerPolicy
-
removeFrom
public boolean removeFrom(java.lang.Object key, java.lang.Object element, java.lang.Object container, AbstractSession session)
INTERNAL: Remove element from container which implements the Map interface.- Overrides:
removeFrom
in classContainerPolicy
-
setElementClass
public void setElementClass(java.lang.Class elementClass)
INTERNAL: Sets the element class which defines the method.
-
isValidContainer
public boolean isValidContainer(java.lang.Object container)
INTERNAL: Validate the container type.- Overrides:
isValidContainer
in classContainerPolicy
- See Also:
CollectionContainerPolicy.isValidContainer(Object)
,isValidContainer(Object)
-
setKeyName
public void setKeyName(java.lang.String keyName, java.lang.String elementClassName)
INTERNAL: Sets the key name to be used to generate the key in a Map type container class. The key name, may be the name of a field or method.- Overrides:
setKeyName
in classContainerPolicy
- See Also:
MapContainerPolicy
-
setKeyName
public void setKeyName(java.lang.String keyName, java.lang.Class elementClass)
INTERNAL: Sets the key name to be used to generate the key in a Map type container class. The key name, may be the name of a field or method. An instance of the class is provided in the case when the descriptor is being built in code.- Overrides:
setKeyName
in classContainerPolicy
-
setKeyName
public void setKeyName(java.lang.String keyName)
INTERNAL: Sets the key name to be used to generate the key in a Map type container class. The key name, maybe the name of a field or method.
-
setKeyMethod
public void setKeyMethod(java.lang.String keyMethodName, java.lang.Class elementClass)
INTERNAL: Sets the Method to be used to generate the key in a Map type container class.
-
setKeyMethod
public void setKeyMethod(java.lang.String keyMethodName, java.lang.String elementClassName)
INTERNAL: Sets the Method to be used to generate the key in a Map type container class.
-
setKeyMethodName
public void setKeyMethodName(java.lang.String keyMethodName)
INTERNAL: Sets the Method to be used to generate the key in a Map type container class.
-
sizeFor
public int sizeFor(java.lang.Object container)
INTERNAL: Return the size of container.- Specified by:
sizeFor
in interfaceCoreContainerPolicy<AbstractSession>
- Overrides:
sizeFor
in classContainerPolicy
-
valueFromPKList
public java.lang.Object valueFromPKList(java.lang.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 classContainerPolicy
-
-