public abstract class ContainerPolicy extends java.lang.Object implements CoreContainerPolicy<AbstractSession>, java.lang.Cloneable, java.io.Serializable
Purpose: Used to support collections in read queries.
Responsibilities: Map the results into the appropriate collection instance. Generically support special collections like cursored stream and virtual collection.
Constructor and Description |
---|
ContainerPolicy()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addAdditionalFieldsToQuery(ReadQuery selectionQuery,
Expression baseExpression)
INTERNAL:
Called when the selection query is being initialized to add any required additional fields to the
query.
|
boolean |
addAll(java.util.List elements,
java.lang.Object container,
AbstractSession session,
java.util.List<AbstractRecord> rows,
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.
|
boolean |
addAll(java.util.List elements,
java.lang.Object container,
AbstractSession session,
java.util.List<AbstractRecord> dbRows,
ObjectBuildingQuery 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.
|
void |
addFieldsForMapKey(AbstractRecord joinRow)
INTERNAL:
Called when the insert query is being initialized to ensure the fields for the key are in the insert query
|
boolean |
addInto(java.lang.Object element,
java.lang.Object container,
AbstractSession session)
INTERNAL:
Add element to container.
|
boolean |
addInto(java.lang.Object element,
java.lang.Object container,
AbstractSession session,
AbstractRecord row,
DataReadQuery query,
CacheKey parentCacheKey,
boolean isTargetProtected)
INTERNAL:
This is used for adding to a direct map or direct collection from the database.
|
boolean |
addInto(java.lang.Object element,
java.lang.Object container,
AbstractSession session,
AbstractRecord dbRow,
ObjectBuildingQuery query,
CacheKey parentCacheKey,
boolean isTargetProtected)
INTERNAL:
Add element to container.
|
boolean |
addInto(java.lang.Object key,
java.lang.Object element,
java.lang.Object container,
AbstractSession session)
INTERNAL:
Add element to container.
|
void |
addNestedJoinsQueriesForMapKey(JoinedAttributeManager joinManager,
ObjectLevelReadQuery query,
AbstractSession session)
INTERNAL:
Used for joining.
|
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) |
java.lang.Object |
buildCloneForKey(java.lang.Object key,
java.lang.Object parent,
CacheKey parentCacheKey,
java.lang.Integer refreshCascade,
AbstractSession cloningSession,
boolean isExisting,
boolean isCacheCheckComplete)
Build a clone for the key of a Map represented by this container policy if necessary.
|
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 be overridden to allow MapContainerPolicy to return a construct that
contains the key and the value
|
java.lang.Object |
buildContainerFromVector(java.util.Vector vector,
AbstractSession session)
INTERNAL:
Return a container populated with the contents of the specified Vector.
|
static ContainerPolicy |
buildDefaultPolicy()
INTERNAL:
Return the appropriate container policy for the default container class.
|
java.lang.Object |
buildKey(AbstractRecord row,
ObjectBuildingQuery query,
CacheKey parentCacheKey,
AbstractSession session,
boolean isTargetProtected)
Extract the key for the map from the provided row
overridden by subclasses that deal with map keys
|
java.lang.Object |
buildKeyFromJoinedRow(AbstractRecord row,
JoinedAttributeManager joinManager,
ObjectBuildingQuery query,
CacheKey parentCacheKey,
AbstractSession session,
boolean isTargetProtected)
Extract the key for the map from the provided row
overridden by subclasses that deal with map keys
|
static ContainerPolicy |
buildPolicyFor(java.lang.Class concreteContainerClass)
INTERNAL:
Return the appropriate container policy for the specified
concrete container class.
|
static ContainerPolicy |
buildPolicyFor(java.lang.Class concreteContainerClass,
boolean hasOrdering)
INTERNAL:
Return the appropriate container policy for the specified
concrete container class.
|
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.
|
ReadQuery |
buildSelectionQueryForDirectCollectionMapping()
INTERNAL:
This
Certain key mappings favor different types of selection query.
|
void |
cascadeDiscoverAndPersistUnregisteredNewObjects(java.lang.Object object,
java.util.Map newObjects,
java.util.Map unregisteredExistingObjects,
java.util.Map visitedObjects,
UnitOfWorkImpl uow,
java.util.Set cascadeErrors)
INTERNAL:
Cascade DiscoverAndPersistUnregisteredNewObjects to any mappings managed by the container policy.
|
void |
cascadePerformRemoveIfRequired(java.lang.Object object,
UnitOfWorkImpl uow,
java.util.Map visitedObjects)
INTERNAL:
Cascade performRemove to any mappings managed by the container policy.
|
void |
cascadeRegisterNewIfRequired(java.lang.Object object,
UnitOfWorkImpl uow,
java.util.Map visitedObjects)
INTERNAL:
Cascade registerNew to any mappings managed by the container policy.
|
void |
clear(java.lang.Object container)
INTERNAL:
Remove all the elements from the specified container.
|
java.lang.Object |
clone() |
ContainerPolicy |
clone(ReadQuery query) |
java.lang.Object |
cloneFor(java.lang.Object container)
INTERNAL:
Return a clone of the specified container.
|
void |
compareCollectionsForChange(java.lang.Object oldCollection,
java.lang.Object newCollection,
CollectionChangeRecord changeRecord,
AbstractSession session,
ClassDescriptor referenceDescriptor)
INTERNAL:
This method is used to calculate the differences between two collections.
|
boolean |
compareKeys(java.lang.Object sourceKey,
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.
|
java.lang.Object |
containerInstance()
INTERNAL:
Return an instance of the container class.
|
java.lang.Object |
containerInstance(int initialCapacity)
INTERNAL:
Return an instance of the container class with the specified initial capacity.
|
boolean |
contains(java.lang.Object element,
java.lang.Object container,
AbstractSession session)
INTERNAL:
Check if the object is contained in the collection.
|
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 implemented by subclasses as necessary.
|
static void |
copyMapDataToRow(java.util.Map mappingData,
AbstractRecord databaseRow)
INTERNAL:
convenience method to copy the keys and values from a Map into an AbstractRecord
|
abstract 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
|
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.
|
void |
deleteWrappedObject(java.lang.Object objectDeleted,
AbstractSession session)
INTERNAL:
Delete the passed object
This may be overridden by subclasses to deal with composite objects
|
boolean |
equals(java.lang.Object object)
INTERNAL:
Return if the policy is equal to the other.
|
java.lang.Object |
execute()
INTERNAL:
This can be used by collection such as cursored stream to gain control over execution.
|
java.util.List<DatabaseField> |
getAdditionalFieldsForJoin(CollectionMapping baseMapping)
INTERNAL:
Return any additional fields required by the policy for a fetch join.
|
java.util.List<DatabaseTable> |
getAdditionalTablesForJoinQuery()
INTERNAL:
Return any tables that will be required when this mapping is used as part of a join query.
|
java.util.Iterator |
getChangeValuesFrom(java.util.Map map)
INTERNAL:
Used to create an iterator on a the Map object passed to CollectionChangeRecord.addRemoveChange()
to access the values to be removed.
|
java.lang.Object |
getCloneDataFromChangeSet(ObjectChangeSet changeSet)
INTERNAL:
Used when objects are added or removed during an update.
|
java.lang.Class |
getContainerClass()
INTERNAL:
Return the class used for the container.
|
java.lang.String |
getContainerClassName()
INTERNAL:
Used by the MW
|
static java.lang.Class |
getDefaultContainerClass()
ADVANCED:
Return the default collection class.
|
ClassDescriptor |
getDescriptorForMapKey()
INTERNAL:
Return the reference descriptor for the map key if it exists
|
ClassDescriptor |
getElementDescriptor()
INTERNAL:
Used for wrapping and unwrapping with the wrapper policy.
|
java.util.List<DatabaseField> |
getIdentityFieldsForMapKey()
INTERNAL:
Return the fields that make up the identity of the key if this mapping is a list
This method will be overridden by subclasses.
|
java.util.Map |
getKeyMappingDataForWriteQuery(java.lang.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.
|
Expression |
getKeySelectionCriteria()
INTERNAL:
Get the selection criteria for the map key
This will be overridden by container policies that allow maps
|
java.lang.Object |
getKeyType()
INTERNAL:
Return the type of the map key, this will be overridden by container policies that allow maps.
|
boolean |
hasElementDescriptor()
INTERNAL:
Used for wrapping and unwrapping with the wrapper policy.
|
abstract boolean |
hasNext(java.lang.Object iterator)
INTERNAL:
Return whether the iterator has more objects.
|
boolean |
hasOrder()
INTERNAL:
Returns true if the collection has order
|
void |
initialize(AbstractSession session,
DatabaseTable keyTable)
INTERNAL:
Provide a hook to allow initialization of Container Policy parts
|
void |
initializeConstructor()
INTERNAL:
Find the size constructor.
|
boolean |
isCollectionPolicy() |
boolean |
isCursoredStreamPolicy() |
boolean |
isCursorPolicy() |
boolean |
isDirectMapPolicy() |
boolean |
isEmpty(java.lang.Object container)
INTERNAL:
Return whether the container is empty.
|
boolean |
isListPolicy() |
boolean |
isMapKeyObject()
INTERNAL:
Return if the map key this container policy represents is a OneToOne.
|
boolean |
isMappedKeyMapPolicy() |
boolean |
isMapPolicy() |
boolean |
isOrderedListPolicy() |
boolean |
isScrollableCursorPolicy() |
boolean |
isValidContainer(java.lang.Object container)
INTERNAL:
Return whether the specified object is of a valid container type.
|
boolean |
isValidContainerType(java.lang.Class containerType)
INTERNAL:
Return whether the specified type is a valid container type.
|
void |
iterateOnMapKey(DescriptorIterator iterator,
java.lang.Object element)
INTERNAL:
Used in Descriptor Iteration to iterate on map keys.
|
abstract 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
This method will be overridden by ContainerPolicies that allows maps.
|
java.lang.Object |
keyFromIterator(java.lang.Object iterator) |
java.lang.Object |
mergeCascadeParts(ObjectChangeSet objectChanges,
MergeManager mergeManager,
AbstractSession targetSession)
INTERNAL:
Merge changes from the source to the target object.
|
void |
mergeChanges(CollectionChangeRecord changeRecord,
java.lang.Object valueOfTarget,
boolean shouldMergeCascadeParts,
MergeManager mergeManager,
AbstractSession targetSession,
boolean isSynchronizeOnMerge)
INTERNAL:
Merge changes from the source to the target object.
|
java.lang.Object |
next(java.lang.Object iterator,
AbstractSession session)
INTERNAL:
Return the next object from the iterator.
|
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.
|
boolean |
overridesRead()
This can be used by collection such as cursored stream to gain control over execution.
|
void |
postCalculateChanges(ObjectChangeSet ocs,
ClassDescriptor referenceDescriptor,
DatabaseMapping mapping,
UnitOfWorkImpl uow)
INTERNAL:
Add the provided object to the deleted objects list on the commit manager.
|
void |
postCalculateChanges(java.lang.Object key,
java.lang.Object value,
ClassDescriptor referenceDescriptor,
DatabaseMapping mapping,
UnitOfWorkImpl uow)
INTERNAL:
Add the provided object to the deleted objects list on the commit manager.
|
void |
postInitialize(AbstractSession session)
INTERNAL:
Some subclasses need to post initialize mappings associated with them
|
void |
prepare(DatabaseQuery query,
AbstractSession session)
Prepare and validate.
|
void |
prepareForExecution()
Prepare and validate.
|
void |
processAdditionalWritableMapKeyFields(AbstractSession session)
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.
|
boolean |
propagatesEventsToCollection()
INTERNAL:
Returns false.
|
void |
propogatePostDelete(DeleteObjectQuery query,
java.lang.Object object)
INTERNAL:
Propagate the postDeleteEvent to any additional objects the query is aware of
This method will be overridden by subclasses that deal MapKeys
|
void |
propogatePostInsert(WriteObjectQuery query,
java.lang.Object object)
INTERNAL:
Propagate the postDeleteEvent to any additional objects the query is aware of
This method will be overridden by subclasses that deal MapKeys
|
void |
propogatePostUpdate(WriteObjectQuery query,
java.lang.Object object)
INTERNAL:
Propagate the postDeleteEvent to any additional objects the query is aware of
This method will be overridden by subclasses that deal MapKeys
|
void |
propogatePreDelete(DeleteObjectQuery query,
java.lang.Object object)
INTERNAL:
Propagate the postDeleteEvent to any additional objects the query is aware of
This method will be overridden by subclasses that deal MapKeys
|
void |
propogatePreInsert(WriteObjectQuery query,
java.lang.Object object)
INTERNAL:
Propagate the postDeleteEvent to any additional objects the query is aware of
This method will be overridden by subclasses that deal MapKeys
|
void |
propogatePreUpdate(WriteObjectQuery query,
java.lang.Object object)
INTERNAL:
Propagate the postDeleteEvent to any additional objects the query is aware of
This method will be overridden by subclasses that deal MapKeys
|
void |
recordAddToCollectionInChangeRecord(ObjectChangeSet changeSetToAdd,
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.
|
void |
recordPrivateOwnedRemovals(java.lang.Object object,
ClassDescriptor referenceDescriptor,
UnitOfWorkImpl uow)
INTERNAL:
Add the provided object to the deleted objects list on the commit manager.
|
void |
recordRemoveFromCollectionInChangeRecord(ObjectChangeSet changeSetToRemove,
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.
|
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.
|
java.lang.Object |
remoteExecute()
This can be used by collection such as cursored stream to gain control over execution.
|
boolean |
removeFrom(java.lang.Object element,
java.lang.Object container,
AbstractSession session)
INTERNAL:
Remove the object from the collection.
|
boolean |
removeFrom(java.lang.Object key,
java.lang.Object element,
java.lang.Object container,
AbstractSession session)
INTERNAL:
Remove the object from the collection.
|
boolean |
requiresDataModificationEvents()
INTERNAL:
Returns whether this ContainerPolicy should requires data modification events when
objects are added or deleted during update
|
void |
setContainerClass(java.lang.Class containerClass)
INTERNAL:
Set the class used for the container.
|
void |
setContainerClassName(java.lang.String containerClassName)
INTERNAL:
Used by the MW
|
static void |
setDefaultContainerClass(java.lang.Class collectionClass)
ADVANCED:
Allow the default collection class to be set.
|
void |
setElementDescriptor(ClassDescriptor elementDescriptor)
INTERNAL:
Used for wrapping and unwrapping with the wrapper policy.
|
void |
setKeyName(java.lang.String instanceVariableName,
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 instanceVariableName,
java.lang.String elementClassName)
INTERNAL:
It is illegal to send this message to this receiver.
|
boolean |
shouldAddAll()
INTERNAL:
Indicates whether addAll method should be called to add entire collection,
or it's possible to call addInto multiple times instead.
|
boolean |
shouldIncludeKeyInDeleteEvent()
INTERNAL:
Return whether data for a map key must be included on a Delete data modification event
This will be overridden by subclasses that handle maps.
|
boolean |
shouldUpdateForeignKeysPostInsert()
INTERNAL:
Certain types of container policies require an extra update statement after a relationship
is inserted.
|
int |
sizeFor(java.lang.Object container)
INTERNAL:
Return the size of container.
|
java.lang.String |
toString() |
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:
Depending on the container, the entries returned of iteration using the ContainerPolicy.iteratorFor() method
may be wrapped.
|
void |
updateChangeRecordForSelfMerge(ChangeRecord changeRecord,
java.lang.Object source,
java.lang.Object target,
ForeignReferenceMapping mapping,
UnitOfWorkChangeSet parentUOWChangeSet,
UnitOfWorkImpl unitOfWork)
INTERNAL:
Update a ChangeRecord to replace the ChangeSet for the old entity with the changeSet for the new Entity.
|
int |
updateJoinedMappingIndexesForMapKey(java.util.Map<DatabaseMapping,java.lang.Object> indexList,
int index)
INTERNAL:
Update the joined mapping indices
This method is a no-op, but will be overridden by subclasses
|
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.
|
java.util.Vector |
vectorFor(java.lang.Object container,
AbstractSession session)
INTERNAL:
Return a Vector populated with the contents of container.
|
public static java.lang.Class getDefaultContainerClass()
public static void setDefaultContainerClass(java.lang.Class collectionClass)
public void addAdditionalFieldsToQuery(ReadQuery selectionQuery, Expression baseExpression)
MappedKeyMapContinerPolicy
public void addFieldsForMapKey(AbstractRecord joinRow)
MappedKeyMapContainerPolicy
public boolean addInto(java.lang.Object element, java.lang.Object container, AbstractSession session)
addInto
in interface CoreContainerPolicy<AbstractSession>
public boolean addInto(java.lang.Object element, java.lang.Object container, AbstractSession session, AbstractRecord dbRow, ObjectBuildingQuery query, CacheKey parentCacheKey, boolean isTargetProtected)
public boolean addAll(java.util.List elements, java.lang.Object container, AbstractSession session, java.util.List<AbstractRecord> dbRows, ObjectBuildingQuery query, CacheKey parentCacheKey, boolean isTargetProtected)
public boolean addInto(java.lang.Object element, java.lang.Object container, AbstractSession session, AbstractRecord row, DataReadQuery query, CacheKey parentCacheKey, boolean isTargetProtected)
public boolean addAll(java.util.List elements, java.lang.Object container, AbstractSession session, java.util.List<AbstractRecord> rows, DataReadQuery query, CacheKey parentCacheKey, boolean isTargetProtected)
public boolean addInto(java.lang.Object key, java.lang.Object element, java.lang.Object container, AbstractSession session)
addInto
in interface CoreContainerPolicy<AbstractSession>
public void addNestedJoinsQueriesForMapKey(JoinedAttributeManager joinManager, ObjectLevelReadQuery query, AbstractSession session)
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)
valuesIterator
- toCollection
- mapping
- unitOfWork
- isExisting
- MappedKeyMapContainerPolicy
public java.lang.Object buildCloneForKey(java.lang.Object key, java.lang.Object parent, CacheKey parentCacheKey, java.lang.Integer refreshCascade, AbstractSession cloningSession, boolean isExisting, boolean isCacheCheckComplete)
key
- cloningSession
- isExisting
- public java.lang.Object buildCollectionEntry(java.lang.Object objectAdded, ObjectChangeSet changeSet)
objectAdded
- changeSet
- MappedKeyMapContainerPolicy
public java.lang.Object buildContainerFromVector(java.util.Vector vector, AbstractSession session)
public java.lang.Object buildKey(AbstractRecord row, ObjectBuildingQuery query, CacheKey parentCacheKey, AbstractSession session, boolean isTargetProtected)
row
- query
- session
- public java.lang.Object[] buildReferencesPKList(java.lang.Object container, AbstractSession session)
ContainerPolicy.buildReferencesPKList()
,
MappedKeyMapContainerPolicy.buildReferencesPKList()
public java.lang.Object buildKeyFromJoinedRow(AbstractRecord row, JoinedAttributeManager joinManager, ObjectBuildingQuery query, CacheKey parentCacheKey, AbstractSession session, boolean isTargetProtected)
row
- query
- session
- public static ContainerPolicy buildDefaultPolicy()
public static ContainerPolicy buildPolicyFor(java.lang.Class concreteContainerClass)
public static ContainerPolicy buildPolicyFor(java.lang.Class concreteContainerClass, boolean hasOrdering)
public ReadQuery buildSelectionQueryForDirectCollectionMapping()
public void clear(java.lang.Object container)
clear
in interface CoreContainerPolicy<AbstractSession>
public abstract 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)
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
public void cascadeDiscoverAndPersistUnregisteredNewObjects(java.lang.Object object, java.util.Map newObjects, java.util.Map unregisteredExistingObjects, java.util.Map visitedObjects, UnitOfWorkImpl uow, java.util.Set cascadeErrors)
public void cascadePerformRemoveIfRequired(java.lang.Object object, UnitOfWorkImpl uow, java.util.Map visitedObjects)
public void cascadeRegisterNewIfRequired(java.lang.Object object, UnitOfWorkImpl uow, java.util.Map visitedObjects)
public java.lang.Object clone()
clone
in class java.lang.Object
public ContainerPolicy clone(ReadQuery query)
public java.lang.Object cloneFor(java.lang.Object container)
public void compareCollectionsForChange(java.lang.Object oldCollection, java.lang.Object newCollection, CollectionChangeRecord changeRecord, AbstractSession session, ClassDescriptor referenceDescriptor)
public void buildChangeSetForNewObjectInCollection(java.lang.Object object, ClassDescriptor referenceDescriptor, UnitOfWorkChangeSet uowChangeSet, AbstractSession session)
public boolean compareKeys(java.lang.Object sourceKey, AbstractSession session)
public java.lang.Object concatenateContainers(java.lang.Object firstContainer, java.lang.Object secondContainer, AbstractSession session)
public java.lang.Object containerInstance()
containerInstance
in interface CoreContainerPolicy<AbstractSession>
public java.lang.Object containerInstance(int initialCapacity)
containerInstance
in interface CoreContainerPolicy<AbstractSession>
public boolean contains(java.lang.Object element, java.lang.Object container, AbstractSession session)
contains
in interface CoreContainerPolicy<AbstractSession>
public void convertClassNamesToClasses(java.lang.ClassLoader classLoader)
classLoader
- public java.lang.Object createWrappedObjectFromExistingWrappedObject(java.lang.Object wrappedObject, java.lang.Object parent, ClassDescriptor referenceDescriptor, MergeManager mergeManager, AbstractSession targetSession)
wrappedObject
- parent
- if this is an aggregate, the owner of the aggregatereferenceDescriptor
- mergeManager
- MappedKeyMapContainerPolicy
public void deleteWrappedObject(java.lang.Object objectDeleted, AbstractSession session)
objectDeleted
- session
- MappedKeyMapContainerPolicy
public java.lang.Object execute()
public java.util.List<DatabaseTable> getAdditionalTablesForJoinQuery()
public java.util.List<DatabaseField> getAdditionalFieldsForJoin(CollectionMapping baseMapping)
public java.util.Iterator getChangeValuesFrom(java.util.Map map)
public java.lang.Object getCloneDataFromChangeSet(ObjectChangeSet changeSet)
public java.lang.Class getContainerClass()
public java.lang.String getContainerClassName()
public ClassDescriptor getDescriptorForMapKey()
public ClassDescriptor getElementDescriptor()
public java.util.List<DatabaseField> getIdentityFieldsForMapKey()
public java.util.Map getKeyMappingDataForWriteQuery(java.lang.Object object, AbstractSession session)
public Expression getKeySelectionCriteria()
public java.lang.Object getKeyType()
public boolean hasElementDescriptor()
public abstract boolean hasNext(java.lang.Object iterator)
hasNext
in interface CoreContainerPolicy<AbstractSession>
iteratorFor(java.lang.Object)
public boolean hasOrder()
public void initialize(AbstractSession session, DatabaseTable keyTable)
public void initializeConstructor()
public boolean isCollectionPolicy()
public boolean isCursoredStreamPolicy()
public boolean isScrollableCursorPolicy()
public boolean isCursorPolicy()
public boolean isDirectMapPolicy()
public boolean isEmpty(java.lang.Object container)
isEmpty
in interface CoreContainerPolicy<AbstractSession>
public boolean isListPolicy()
isListPolicy
in interface CoreContainerPolicy<AbstractSession>
public boolean isOrderedListPolicy()
public boolean isMapPolicy()
public boolean isMappedKeyMapPolicy()
public boolean isMapKeyObject()
public boolean isValidContainer(java.lang.Object container)
public boolean isValidContainerType(java.lang.Class containerType)
public void iterateOnMapKey(DescriptorIterator iterator, java.lang.Object element)
public abstract java.lang.Object iteratorFor(java.lang.Object container)
iteratorFor
in interface CoreContainerPolicy<AbstractSession>
hasNext(java.lang.Object)
,
next(java.lang.Object)
public java.lang.Object keyFrom(java.lang.Object element, AbstractSession session)
public java.lang.Object keyFromEntry(java.lang.Object entry)
public java.lang.Object keyFromIterator(java.lang.Object iterator)
public java.lang.Object mergeCascadeParts(ObjectChangeSet objectChanges, MergeManager mergeManager, AbstractSession targetSession)
public void mergeChanges(CollectionChangeRecord changeRecord, java.lang.Object valueOfTarget, boolean shouldMergeCascadeParts, MergeManager mergeManager, AbstractSession targetSession, boolean isSynchronizeOnMerge)
public java.lang.Object next(java.lang.Object iterator, AbstractSession session)
next
in interface CoreContainerPolicy<AbstractSession>
public java.lang.Object nextEntry(java.lang.Object iterator)
nextEntry
in interface CoreContainerPolicy<AbstractSession>
iteratorFor(java.lang.Object)
,
MapContainerPolicy.unwrapIteratorResult(Object object)
public java.lang.Object nextEntry(java.lang.Object iterator, AbstractSession session)
nextEntry
in interface CoreContainerPolicy<AbstractSession>
ContainerPolicy#iteratorFor(Object iterator, AbstractSession session)
,
MapContainerPolicy.unwrapIteratorResult(Object object)
public boolean overridesRead()
public void postInitialize(AbstractSession session)
public void postCalculateChanges(ObjectChangeSet ocs, ClassDescriptor referenceDescriptor, DatabaseMapping mapping, UnitOfWorkImpl uow)
object
- manager
- MappedKeyMapContainerPolicy
public void postCalculateChanges(java.lang.Object key, java.lang.Object value, ClassDescriptor referenceDescriptor, DatabaseMapping mapping, UnitOfWorkImpl uow)
public void recordPrivateOwnedRemovals(java.lang.Object object, ClassDescriptor referenceDescriptor, UnitOfWorkImpl uow)
public void prepare(DatabaseQuery query, AbstractSession session) throws QueryException
QueryException
public void prepareForExecution() throws QueryException
QueryException
public void processAdditionalWritableMapKeyFields(AbstractSession session)
public void propogatePostDelete(DeleteObjectQuery query, java.lang.Object object)
public void propogatePostInsert(WriteObjectQuery query, java.lang.Object object)
public void propogatePostUpdate(WriteObjectQuery query, java.lang.Object object)
public void propogatePreDelete(DeleteObjectQuery query, java.lang.Object object)
public void propogatePreInsert(WriteObjectQuery query, java.lang.Object object)
public void propogatePreUpdate(WriteObjectQuery query, java.lang.Object object)
public boolean propagatesEventsToCollection()
public void recordAddToCollectionInChangeRecord(ObjectChangeSet changeSetToAdd, CollectionChangeRecord collectionChangeRecord)
public void recordRemoveFromCollectionInChangeRecord(ObjectChangeSet changeSetToRemove, CollectionChangeRecord collectionChangeRecord)
public void recordUpdateToCollectionInChangeRecord(CollectionChangeEvent event, ObjectChangeSet changeSet, CollectionChangeRecord collectionChangeRecord)
public java.lang.Object remoteExecute()
public boolean removeFrom(java.lang.Object key, java.lang.Object element, java.lang.Object container, AbstractSession session)
public boolean removeFrom(java.lang.Object element, java.lang.Object container, AbstractSession session)
removeFrom
in interface CoreContainerPolicy<AbstractSession>
public boolean requiresDataModificationEvents()
public void setContainerClass(java.lang.Class containerClass)
setContainerClass
in interface CoreContainerPolicy<AbstractSession>
public void setContainerClassName(java.lang.String containerClassName)
public void setElementDescriptor(ClassDescriptor elementDescriptor)
public void setKeyName(java.lang.String instanceVariableName, java.lang.String elementClassName)
MapContainerPolicy
public void setKeyName(java.lang.String instanceVariableName, java.lang.Class elementClass)
public boolean shouldAddAll()
public boolean shouldIncludeKeyInDeleteEvent()
public boolean shouldUpdateForeignKeysPostInsert()
public int sizeFor(java.lang.Object container)
sizeFor
in interface CoreContainerPolicy<AbstractSession>
public java.lang.String toString()
toString
in class java.lang.Object
public int updateJoinedMappingIndexesForMapKey(java.util.Map<DatabaseMapping,java.lang.Object> indexList, int index)
public void updateChangeRecordForSelfMerge(ChangeRecord changeRecord, java.lang.Object source, java.lang.Object target, ForeignReferenceMapping mapping, UnitOfWorkChangeSet parentUOWChangeSet, UnitOfWorkImpl unitOfWork)
public java.lang.Object unwrapElement(java.lang.Object object)
MapContainerPolicy.nextWrapped(Object iterator)
public java.lang.Object unwrapIteratorResult(java.lang.Object object)
MapContainerPolicy.unwrapIteratorResult(Object object)
public java.lang.Object valueFromPKList(java.lang.Object[] pks, AbstractRecord foreignKeys, ForeignReferenceMapping mapping, AbstractSession session)
public java.util.Vector vectorFor(java.lang.Object container, AbstractSession session)
vectorFor
in interface CoreContainerPolicy<AbstractSession>
public static void copyMapDataToRow(java.util.Map mappingData, AbstractRecord databaseRow)
mappingData
- a Map containing a database field as the key and the value of that field as the valuedatabaseRow
- EclipseLink 2.6.3, "build v20160428-59c81c5" API Reference