Purpose: This class holds the record of the changes made to a collection attribute of an object.
Description: Collections must be compared to each other and added and removed objects must be recorded separately.
| Modifier and Type | Class and Description |
|---|---|
| public static class |
| Modifier and Type | Field and Description |
|---|---|
| protected HashMap | |
| protected Map | changedIndexes
Used only in case listOrderField != null in the mapping. |
| protected HashMap | commitAddMap
Contains the number of objects that must be inserted to once the value is removed in the database as a delete where value = "value" will remove all instances of that value in the database not just one. |
| protected boolean | |
| protected boolean | |
| protected boolean | |
| protected boolean | |
| protected int | |
| protected int | |
| protected boolean | orderHasBeenRepaired
Indicates whether IndirectList's order has been repaired. |
| protected HashMap |
| Access | Constructor and Description |
|---|---|
| public | |
| public | DirectCollectionChangeRecord(ObjectChangeSet owner)
This constructor returns a changeRecord representing the DirectCollection mapping. |
| Modifier and Type | Method and Description |
|---|---|
| public void | addAdditionChange(HashMap<K, V> additions, HashMap<K, V> databaseCount)
This method takes a map of primitive objects and adds them to the add list. |
| public void | addAdditionChange(Object key, Integer count)
This method takes a single addition value and records it. |
| public void | addRemoveChange(HashMap<K, V> additions, HashMap<K, V> databaseCount)
This method takes a hashtable of primitive objects and adds them to the remove list. |
| public void | addRemoveChange(Object key, Integer count)
This method takes a single remove change and integrates it with this changeset. |
| public void | clearChanges()
Implements abstract org. |
| public void | |
| public Vector | getAddObjectList()
Implements org. |
| public HashMap | |
| public Map | |
| public HashMap | |
| public int | |
| public int | |
| public Vector | getRemoveObjectList()
Implements org. |
| public HashMap | getRemoveObjectMap()
This method returns the collection of objects that were removed from the collection. |
| public boolean | |
| public void | |
| public void | internalRecreateOriginalCollection(Object currentCollection, AbstractSession session)
Implements abstract org. |
| public boolean | |
| public boolean | |
| public void | mergeRecord(ChangeRecord mergeFromRecord, UnitOfWorkChangeSet mergeToChangeSet, UnitOfWorkChangeSet mergeFromChangeSet)
Implements abstract org. |
| public boolean | |
| public void | |
| public void | setCommitAddition(Hashtable<K, V> additions)
This method takes a hashtable of primitives and adds them to the commit list. |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | storeDatabaseCounts(Object collection, ContainerPolicy containerPolicy, AbstractSession session)
This method will iterate over the collection and store the database counts for the objects within the collection, this is used for minimal updates. |
| public void | updateReferences(UnitOfWorkChangeSet mergeToChangeSet, UnitOfWorkChangeSet mergeFromChangeSet)
Implements abstract org. |
| addObjectMap | back to summary |
|---|---|
| protected HashMap<K, V> addObjectMap | |
| changedIndexes | back to summary |
|---|---|
| protected Map<K, V> changedIndexes Used only in case listOrderField != null in the mapping. Maps each object which has been added or removed or which order in the list has changed to an array of two (non-intersecting) sets of indexes - old and new. | |
| commitAddMap | back to summary |
|---|---|
| protected HashMap<K, V> commitAddMap Contains the number of objects that must be inserted to once the value is removed in the database as a delete where value = "value" will remove all instances of that value in the database not just one. | |
| isFirstToAdd | back to summary |
|---|---|
| protected boolean isFirstToAdd | |
| isFirstToAddAlreadyInCollection | back to summary |
|---|---|
| protected boolean isFirstToAddAlreadyInCollection | |
| isFirstToRemove | back to summary |
|---|---|
| protected boolean isFirstToRemove | |
| isFirstToRemoveAlreadyOutCollection | back to summary |
|---|---|
| protected boolean isFirstToRemoveAlreadyOutCollection | |
| newSize | back to summary |
|---|---|
| protected int newSize | |
| oldSize | back to summary |
|---|---|
| protected int oldSize | |
| orderHasBeenRepaired | back to summary |
|---|---|
| protected boolean orderHasBeenRepaired Indicates whether IndirectList's order has been repaired. | |
| removeObjectMap | back to summary |
|---|---|
| protected HashMap<K, V> removeObjectMap | |
| DirectCollectionChangeRecord | back to summary |
|---|---|
| public DirectCollectionChangeRecord() This default constructor. | |
| DirectCollectionChangeRecord | back to summary |
|---|---|
| public DirectCollectionChangeRecord(ObjectChangeSet owner) This constructor returns a changeRecord representing the DirectCollection mapping. | |
| addAdditionChange | back to summary |
|---|---|
| public void addAdditionChange(HashMap<K, V> additions, HashMap<K, V> databaseCount) This method takes a map of primitive objects and adds them to the add list. The map stores the number of times the object is in the list. | |
| addAdditionChange | back to summary |
|---|---|
| public void addAdditionChange(Object key, Integer count) This method takes a single addition value and records it. | |
| addRemoveChange | back to summary |
|---|---|
| public void addRemoveChange(HashMap<K, V> additions, HashMap<K, V> databaseCount) This method takes a hashtable of primitive objects and adds them to the remove list. Each reference in the hashtable lists the number of this object that needs to be removed from the collection. | |
| addRemoveChange | back to summary |
|---|---|
| public void addRemoveChange(Object key, Integer count) This method takes a single remove change and integrates it with this changeset. | |
| clearChanges | back to summary |
|---|---|
| public void clearChanges() Implements abstract org. Clears info about added / removed objects set by change tracker.
| |
| decrementDatabaseCount | back to summary |
|---|---|
| public void decrementDatabaseCount(Object object) Decrement the count for object | |
| getAddObjectList | back to summary |
|---|---|
| public Vector Implements org. ADVANCED: This method returns the list of added objects.
| |
| getAddObjectMap | back to summary |
|---|---|
| public HashMap This method returns the collection of objects that were added to the collection. | |
| getChangedIndexes | back to summary |
|---|---|
| public Map | |
| getCommitAddMap | back to summary |
|---|---|
| public HashMap This method returns the collection of objects that were added to the collection. | |
| getNewSize | back to summary |
|---|---|
| public int getNewSize() | |
| getOldSize | back to summary |
|---|---|
| public int getOldSize() | |
| getRemoveObjectList | back to summary |
|---|---|
| public Vector Implements org. ADVANCED: This method returns the list of removed objects.
| |
| getRemoveObjectMap | back to summary |
|---|---|
| public HashMap This method returns the collection of objects that were removed from the collection. | |
| hasChanges | back to summary |
|---|---|
| public boolean hasChanges() Returns true if the change set has changes. | |
| incrementDatabaseCount | back to summary |
|---|---|
| public void incrementDatabaseCount(Object object) Increment the count for object | |
| internalRecreateOriginalCollection | back to summary |
|---|---|
| public void internalRecreateOriginalCollection(Object currentCollection, AbstractSession session) Implements abstract org. Recreates the original state of the collection.
| |
| isFirstToAddAlreadyInCollection | back to summary |
|---|---|
| public boolean isFirstToAddAlreadyInCollection() | |
| isFirstToRemoveAlreadyOutCollection | back to summary |
|---|---|
| public boolean isFirstToRemoveAlreadyOutCollection() | |
| mergeRecord | back to summary |
|---|---|
| public void mergeRecord(ChangeRecord mergeFromRecord, UnitOfWorkChangeSet mergeToChangeSet, UnitOfWorkChangeSet mergeFromChangeSet) Implements abstract org. This method will be used to merge one record into another.
| |
| orderHasBeenRepaired | back to summary |
|---|---|
| public boolean orderHasBeenRepaired() | |
| setChangedIndexes | back to summary |
|---|---|
| public void setChangedIndexes(Map<K, V> changedIndexes) | |
| setCommitAddition | back to summary |
|---|---|
| public void setCommitAddition(Hashtable<K, V> additions) This method takes a hashtable of primitives and adds them to the commit list. This count value provided is the number of instances that will need to be inserted into the database once a remove has occurred. This is only set once for each object type. | |
| setFirstToAddAlreadyInCollection | back to summary |
|---|---|
| public void setFirstToAddAlreadyInCollection(boolean flag) | |
| setFirstToRemoveAlreadyOutCollection | back to summary |
|---|---|
| public void setFirstToRemoveAlreadyOutCollection(boolean flag) | |
| setNewSize | back to summary |
|---|---|
| public void setNewSize(int size) | |
| setOldSize | back to summary |
|---|---|
| public void setOldSize(int size) | |
| setOrderHasBeenRepaired | back to summary |
|---|---|
| public void setOrderHasBeenRepaired(boolean hasBeenRepaired) | |
| storeDatabaseCounts | back to summary |
|---|---|
| public void storeDatabaseCounts(Object collection, ContainerPolicy containerPolicy, AbstractSession session) This method will iterate over the collection and store the database counts for the objects within the collection, this is used for minimal updates. | |
| updateReferences | back to summary |
|---|---|
| public void updateReferences(UnitOfWorkChangeSet mergeToChangeSet, UnitOfWorkChangeSet mergeFromChangeSet) Implements abstract org. This method will be used to update the objectsChangeSets references
| |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object
the reference object with which to compare. object)Overrides java. |
| NULL | back to summary |
|---|---|
| public NULL() | |
| equals | back to summary |
|---|---|
| public boolean equals(Object object) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |