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.
ContainerPolicy, CollectionContainerPolicy, ListContainerPolicy
| Modifier and Type | Field and Description |
|---|---|
| protected DatabaseField | |
| protected static final String | |
| protected OrderCorrectionType |
| Access | Constructor and Description |
|---|---|
| public | |
| public | OrderedListContainerPolicy(Class<?> containerClass)
INTERNAL: Construct a new policy for the specified class. |
| public | OrderedListContainerPolicy(String containerClassName)
INTERNAL: Construct a new policy for the specified class name. |
| Modifier and Type | Method and Description |
|---|---|
| public void | addAdditionalFieldsToQuery(ReadQuery selectionQuery, Expression baseExpression)
Overrides org. |
| public boolean | addAll(List<E> elements, Object container, AbstractSession session, List<AbstractRecord> dbRows, ObjectBuildingQuery query, CacheKey parentCacheKey, boolean isTargetProtected)
Overrides org. |
| public boolean | addAll(List<E> elements, Object container, AbstractSession session, List<AbstractRecord> dbRows, DataReadQuery query, CacheKey parentCacheKey, boolean isTargetProtected)
Overrides org. |
| protected boolean | addAll(List<E> elements, Object container, AbstractSession session, List<AbstractRecord> dbRows, ReadQuery query, CacheKey parentCacheKey)
|
| protected void | addIntoAtIndex(Integer index, Object object, Object container, AbstractSession session)
INTERNAL: Add element into a container which implements the List interface. |
| public void | compareCollectionsForChange(Object oldList, Object newList, CollectionChangeRecord changeRecord, AbstractSession session, ClassDescriptor referenceDescriptor)
Overrides org. |
| public List | |
| public List | getAdditionalFieldsForJoin(CollectionMapping baseMapping)
Overrides org. |
| public List | getAdditionalTablesForJoinQuery()
Overrides org. |
| public Iterator | getChangeValuesFrom(Map<K, V> map)
Overrides org. |
| public DatabaseField | |
| public OrderCorrectionType | |
| public boolean | |
| public Object | iteratorFor(Object
java.lang.Object container)Overrides org. Implements org. |
| public void | mergeChanges(CollectionChangeRecord changeRecord, Object valueOfTarget, boolean shouldMergeCascadeParts, MergeManager mergeManager, AbstractSession targetSession, boolean isSynchronizeOnMerge)
Overrides org. |
| protected void | mergeChanges(CollectionChangeRecord changeRecord, Object valueOfTarget, boolean shouldMergeCascadeParts, MergeManager mergeManager, AbstractSession targetSession)
Overrides org. |
| public void | recordAddToCollectionInChangeRecord(ObjectChangeSet changeSetToAdd, CollectionChangeRecord collectionChangeRecord)
Overrides org. |
| public 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.
|
| public void | recordUpdateToCollectionInChangeRecord(CollectionChangeEvent event, ObjectChangeSet changeSet, CollectionChangeRecord collectionChangeRecord)
Overrides org. |
| protected void | registerRemoveNewObjectIfRequired(ObjectChangeSet objectChanges, MergeManager mergeManager)
INTERNAL: |
| protected void | |
| public void | |
| public void | |
| public boolean | shouldAddAll()
Overrides org. |
| public void | updateChangeRecordForSelfMerge(ChangeRecord changeRecord, Object source, Object target, ForeignReferenceMapping mapping, UnitOfWorkChangeSet parentUOWChangeSet, UnitOfWorkImpl unitOfWork)
Overrides org. |
| public int | updateJoinedMappingIndexesForMapKey(Map<DatabaseMapping, Object> indexList, int index)
Overrides org. |
| listOrderField | back to summary |
|---|---|
| protected DatabaseField listOrderField | |
| NOT_SET | back to summary |
|---|---|
| protected static final String NOT_SET | |
| orderCorrectionType | back to summary |
|---|---|
| protected OrderCorrectionType orderCorrectionType | |
| OrderedListContainerPolicy | back to summary |
|---|---|
| public OrderedListContainerPolicy() INTERNAL: Construct a new policy. | |
| OrderedListContainerPolicy | back to summary |
|---|---|
| public OrderedListContainerPolicy(Class<?> containerClass) INTERNAL: Construct a new policy for the specified class. | |
| OrderedListContainerPolicy | back to summary |
|---|---|
| public OrderedListContainerPolicy(String containerClassName) INTERNAL: Construct a new policy for the specified class name. | |
| addAdditionalFieldsToQuery | back to summary |
|---|---|
| public void addAdditionalFieldsToQuery(ReadQuery selectionQuery, Expression baseExpression) Overrides org. INTERNAL: Add the index field to the query.
| |
| addAll | back to summary |
|---|---|
| public boolean addAll(List<E> elements, Object container, AbstractSession session, List<AbstractRecord> dbRows, ObjectBuildingQuery query, CacheKey parentCacheKey, boolean isTargetProtected) Overrides org. INTERNAL: Add a list of elements to container. This is used to add to a collection independent of JDK 1.1 and 1.2. The session may be required to wrap for the wrapper policy. The row may be required by subclasses Return whether the container changed
| |
| addAll | back to summary |
|---|---|
| public boolean addAll(List<E> elements, Object container, AbstractSession session, List<AbstractRecord> dbRows, DataReadQuery query, CacheKey parentCacheKey, boolean isTargetProtected) Overrides org. INTERNAL: Add a list of elements to container. This is used to add to a collection independent of JDK 1.1 and 1.2. The session may be required to wrap for the wrapper policy. The row may be required by subclasses Return whether the container changed
| |
| addAll | back to summary |
|---|---|
| protected boolean addAll(List<E> elements, Object container, AbstractSession session, List<AbstractRecord> dbRows, ReadQuery query, CacheKey parentCacheKey) | |
| addIntoAtIndex | back to summary |
|---|---|
| protected void addIntoAtIndex(Integer index, Object object, Object container, AbstractSession session) INTERNAL: Add element into a container which implements the List interface. Add at a particular index. | |
| compareCollectionsForChange | back to summary |
|---|---|
| public void compareCollectionsForChange(Object oldList, Object newList, CollectionChangeRecord changeRecord, AbstractSession session, ClassDescriptor referenceDescriptor) Overrides org. INTERNAL: This method is used to calculate the differences between two collections. This algorithm is a work in progress. It works great and all, but like anything, you can always make it better.
| |
| correctOrderList | back to summary |
|---|---|
| public List PUBLIC: Correct object's order in the list. The method is called only in one case - when the list of order indexes read from db is invalid (contains nulls, duplicates, negative values, values greater/equal list size). Each element of the indexedObjects is a pair of the order index and the corresponding object. The goal of the method is to return back the list of objects (not indexed objects!) in the correct order. The objects should not be altered. The default implementation of the method sorts indexedObjects according to their indexes (null less than any non-null). For example: indexedObjects = {{2, objectA}, {5, ObjectB}} returns {objectA, objectB}; indexedObjects = {{2, objectA}, {-1, ObjectB}} returns {objectB, objectA}; indexedObjects = {{2, objectA}, {null, ObjectB}} returns {objectB, objectA}; This method could be overridden by the user. | |
| getAdditionalFieldsForJoin | back to summary |
|---|---|
| public List Overrides org. INTERNAL: Return any additional fields required by the policy for a fetch join.
| |
| getAdditionalTablesForJoinQuery | back to summary |
|---|---|
| public List Overrides org. INTERNAL: Return any tables that will be required when this mapping is used as part of a join query.
| |
| getChangeValuesFrom | back to summary |
|---|---|
| public Iterator Overrides org. INTERNAL: Used to create an iterator on a the Map object passed to CollectionChangeRecord.addRemoveChange() to access the values to be removed. In the case of some container policies the values will actually be the keys.
| |
| getListOrderField | back to summary |
|---|---|
| public DatabaseField getListOrderField() | |
| getOrderCorrectionType | back to summary |
|---|---|
| public OrderCorrectionType getOrderCorrectionType() | |
| isOrderedListPolicy | back to summary |
|---|---|
| public boolean isOrderedListPolicy() Overrides org.
| |
| iteratorFor | back to summary |
|---|---|
| public Object iteratorFor(Object container) Overrides org. Implements org. INTERNAL: Return an list iterator for the given container.
| |
| mergeChanges | back to summary |
|---|---|
| public void mergeChanges(CollectionChangeRecord changeRecord, Object valueOfTarget, boolean shouldMergeCascadeParts, MergeManager mergeManager, AbstractSession targetSession, boolean isSynchronizeOnMerge) Overrides org. INTERNAL: Merge changes from the source to the target object. Because this is a collection mapping, values are added to or removed from the collection based on the change set. Synchronize if system property is specified. If not, default to clone the target collection. No need to synchronize if the collection is new.
| |
| mergeChanges | back to summary |
|---|---|
| protected void mergeChanges(CollectionChangeRecord changeRecord, Object valueOfTarget, boolean shouldMergeCascadeParts, MergeManager mergeManager, AbstractSession targetSession) Overrides org. INTERNAL: Merge changes from the source to the target object. Because this is a collection mapping, values are added to or removed from the collection based on the change set.
| |
| recordAddToCollectionInChangeRecord | back to summary |
|---|---|
| public void recordAddToCollectionInChangeRecord(ObjectChangeSet changeSetToAdd, CollectionChangeRecord collectionChangeRecord) Overrides org. 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
| |
| recordRemoveFromCollectionInChangeRecord | back to summary |
|---|---|
| public 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. Each ContainerPolicy type will implement specific behavior for the collection type it is wrapping. These methods are only valid for collections containing object references
| |
| recordUpdateToCollectionInChangeRecord | back to summary |
|---|---|
| public void recordUpdateToCollectionInChangeRecord(CollectionChangeEvent event, ObjectChangeSet changeSet, CollectionChangeRecord collectionChangeRecord) Overrides org. Doc from org. 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
| |
| registerRemoveNewObjectIfRequired | back to summary |
|---|---|
| protected void registerRemoveNewObjectIfRequired(ObjectChangeSet objectChanges, MergeManager mergeManager) INTERNAL: | |
| removeFromAtIndex | back to summary |
|---|---|
| protected void removeFromAtIndex(int index, Object container) INTERNAL: Remove the element at the specified index. | |
| setListOrderField | back to summary |
|---|---|
| public void setListOrderField(DatabaseField field) | |
| setOrderCorrectionType | back to summary |
|---|---|
| public void setOrderCorrectionType(OrderCorrectionType orderCorrectionType) | |
| shouldAddAll | back to summary |
|---|---|
| public boolean shouldAddAll() Overrides org. INTERNAL: Indicates whether addAll method should be called to add entire collection, or it's possible to call addInto multiple times instead.
| |
| updateChangeRecordForSelfMerge | back to summary |
|---|---|
| public void updateChangeRecordForSelfMerge(ChangeRecord changeRecord, Object source, Object target, ForeignReferenceMapping mapping, UnitOfWorkChangeSet parentUOWChangeSet, UnitOfWorkImpl unitOfWork) Overrides org. INTERNAL: Update a ChangeRecord to replace the ChangeSet for the old entity with the changeSet for the new Entity. This is used when an Entity is merged into itself and the Entity reference new or detached entities.
| |
| updateJoinedMappingIndexesForMapKey | back to summary |
|---|---|
| public int updateJoinedMappingIndexesForMapKey(Map<DatabaseMapping, Object> indexList, int index) Overrides org. INTERNAL: Add the index field count.
| |