public class OrderedListContainerPolicy extends ListContainerPolicy
Purpose: A OrderedListContainerPolicy is ContainerPolicy whose container class implements the List interface and is ordered by an @OrderBy.
Responsibilities: Provide the functionality to operate on an instance of a List.
Constructor and Description |
---|
OrderedListContainerPolicy()
INTERNAL:
Construct a new policy.
|
OrderedListContainerPolicy(java.lang.Class containerClass)
INTERNAL:
Construct a new policy for the specified class.
|
OrderedListContainerPolicy(java.lang.String containerClassName)
INTERNAL:
Construct a new policy for the specified class name.
|
Modifier and Type | Method and Description |
---|---|
void |
addAdditionalFieldsToQuery(ReadQuery selectionQuery,
Expression baseExpression)
INTERNAL:
Add the index field to the query.
|
boolean |
addAll(java.util.List elements,
java.lang.Object container,
AbstractSession session,
java.util.List<AbstractRecord> dbRows,
DataReadQuery query,
CacheKey parentCacheKey,
boolean isTargetProtected)
INTERNAL:
Add a list of elements to container.
|
boolean |
addAll(java.util.List elements,
java.lang.Object container,
AbstractSession session,
java.util.List<AbstractRecord> dbRows,
ObjectBuildingQuery query,
CacheKey parentCacheKey,
boolean isTargetProtected)
INTERNAL:
Add a list of elements to container.
|
void |
compareCollectionsForChange(java.lang.Object oldList,
java.lang.Object newList,
CollectionChangeRecord changeRecord,
AbstractSession session,
ClassDescriptor referenceDescriptor)
INTERNAL:
This method is used to calculate the differences between two collections.
|
java.util.List |
correctOrderList(java.util.List<IndexedObject> indexedObjects)
PUBLIC:
Correct object's order in the list.
|
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.
|
DatabaseField |
getListOrderField() |
OrderCorrectionType |
getOrderCorrectionType() |
boolean |
isOrderedListPolicy() |
java.lang.Object |
iteratorFor(java.lang.Object container)
INTERNAL:
Return an list iterator for the given container.
|
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.
|
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 |
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.
|
void |
setListOrderField(DatabaseField field) |
void |
setOrderCorrectionType(OrderCorrectionType orderCorrectionType) |
boolean |
shouldAddAll()
INTERNAL:
Indicates whether addAll method should be called to add entire collection,
or it's possible to call addInto multiple times instead.
|
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:
Add the index field count.
|
get, hasOrder, indexOf, isListPolicy, isValidContainer, valueFromPKList
addInto, buildContainerFromVector, clear, cloneFor, getInterfaceType, isCollectionPolicy, sizeFor
convertClassNamesToClasses, createChangeEvent, createQueryKeyForMapKey, equals, getCloneMethod, getContainerClass, getContainerClassName, getDirectKeyField, hasNext, isMapKeyAttribute, isValidContainerType, setCloneMethod, setContainerClass, setContainerClassName
addFieldsForMapKey, addInto, addInto, addInto, addNestedJoinsQueriesForMapKey, addNextValueFromIteratorInto, buildChangeSetForNewObjectInCollection, buildCloneForKey, buildCollectionEntry, buildDefaultPolicy, buildKey, buildKeyFromJoinedRow, buildPolicyFor, buildPolicyFor, buildReferencesPKList, buildSelectionQueryForDirectCollectionMapping, cascadeDiscoverAndPersistUnregisteredNewObjects, cascadePerformRemoveIfRequired, cascadeRegisterNewIfRequired, clone, clone, compareKeys, concatenateContainers, containerInstance, containerInstance, contains, copyMapDataToRow, createWrappedObjectFromExistingWrappedObject, deleteWrappedObject, execute, getCloneDataFromChangeSet, getDefaultContainerClass, getDescriptorForMapKey, getElementDescriptor, getIdentityFieldsForMapKey, getKeyMappingDataForWriteQuery, getKeySelectionCriteria, getKeyType, hasElementDescriptor, initialize, initializeConstructor, isCursoredStreamPolicy, isCursorPolicy, isDirectMapPolicy, isEmpty, isMapKeyObject, isMappedKeyMapPolicy, isMapPolicy, isScrollableCursorPolicy, iterateOnMapKey, keyFrom, keyFromEntry, keyFromIterator, mergeCascadeParts, next, nextEntry, nextEntry, overridesRead, postCalculateChanges, postCalculateChanges, postInitialize, prepare, prepareForExecution, processAdditionalWritableMapKeyFields, propagatesEventsToCollection, propogatePostDelete, propogatePostInsert, propogatePostUpdate, propogatePreDelete, propogatePreInsert, propogatePreUpdate, recordPrivateOwnedRemovals, remoteExecute, removeFrom, removeFrom, requiresDataModificationEvents, setDefaultContainerClass, setElementDescriptor, setKeyName, setKeyName, shouldIncludeKeyInDeleteEvent, shouldUpdateForeignKeysPostInsert, toString, unwrapElement, unwrapIteratorResult, vectorFor
public OrderedListContainerPolicy()
public OrderedListContainerPolicy(java.lang.Class containerClass)
public OrderedListContainerPolicy(java.lang.String containerClassName)
public boolean addAll(java.util.List elements, java.lang.Object container, AbstractSession session, java.util.List<AbstractRecord> dbRows, ObjectBuildingQuery query, CacheKey parentCacheKey, boolean isTargetProtected)
addAll
in class ContainerPolicy
public boolean addAll(java.util.List elements, java.lang.Object container, AbstractSession session, java.util.List<AbstractRecord> dbRows, DataReadQuery query, CacheKey parentCacheKey, boolean isTargetProtected)
addAll
in class ContainerPolicy
public void compareCollectionsForChange(java.lang.Object oldList, java.lang.Object newList, CollectionChangeRecord changeRecord, AbstractSession session, ClassDescriptor referenceDescriptor)
compareCollectionsForChange
in class ContainerPolicy
public java.util.List correctOrderList(java.util.List<IndexedObject> indexedObjects)
public java.util.Iterator getChangeValuesFrom(java.util.Map map)
getChangeValuesFrom
in class ContainerPolicy
public DatabaseField getListOrderField()
public void setListOrderField(DatabaseField field)
public OrderCorrectionType getOrderCorrectionType()
public void setOrderCorrectionType(OrderCorrectionType orderCorrectionType)
public java.lang.Object iteratorFor(java.lang.Object container)
iteratorFor
in interface CoreContainerPolicy<AbstractSession>
iteratorFor
in class CollectionContainerPolicy
container
- java.lang.ObjectContainerPolicy.hasNext(java.lang.Object)
,
ContainerPolicy.next(java.lang.Object)
public boolean isOrderedListPolicy()
isOrderedListPolicy
in class ContainerPolicy
public void mergeChanges(CollectionChangeRecord changeRecord, java.lang.Object valueOfTarget, boolean shouldMergeCascadeParts, MergeManager mergeManager, AbstractSession targetSession, boolean isSynchronizeOnMerge)
mergeChanges
in class ContainerPolicy
public void recordAddToCollectionInChangeRecord(ObjectChangeSet changeSetToAdd, CollectionChangeRecord collectionChangeRecord)
recordAddToCollectionInChangeRecord
in class ListContainerPolicy
public void recordRemoveFromCollectionInChangeRecord(ObjectChangeSet changeSetToRemove, CollectionChangeRecord collectionChangeRecord)
ListContainerPolicy
recordRemoveFromCollectionInChangeRecord
in class ListContainerPolicy
public void recordUpdateToCollectionInChangeRecord(CollectionChangeEvent event, ObjectChangeSet changeSet, CollectionChangeRecord collectionChangeRecord)
ContainerPolicy
recordUpdateToCollectionInChangeRecord
in class ContainerPolicy
public boolean shouldAddAll()
shouldAddAll
in class ContainerPolicy
public java.util.List<DatabaseField> getAdditionalFieldsForJoin(CollectionMapping baseMapping)
getAdditionalFieldsForJoin
in class ContainerPolicy
public int updateJoinedMappingIndexesForMapKey(java.util.Map<DatabaseMapping,java.lang.Object> indexList, int index)
updateJoinedMappingIndexesForMapKey
in class ContainerPolicy
public void updateChangeRecordForSelfMerge(ChangeRecord changeRecord, java.lang.Object source, java.lang.Object target, ForeignReferenceMapping mapping, UnitOfWorkChangeSet parentUOWChangeSet, UnitOfWorkImpl unitOfWork)
updateChangeRecordForSelfMerge
in class ListContainerPolicy
public java.util.List<DatabaseTable> getAdditionalTablesForJoinQuery()
getAdditionalTablesForJoinQuery
in class ContainerPolicy
public void addAdditionalFieldsToQuery(ReadQuery selectionQuery, Expression baseExpression)
addAdditionalFieldsToQuery
in class ContainerPolicy
MappedKeyMapContinerPolicy
EclipseLink 2.6.3, "build v20160428-59c81c5" API Reference