public class DirectCollectionChangeRecord extends DeferrableChangeRecord implements DirectCollectionChangeRecord
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 |
---|---|
static class |
DirectCollectionChangeRecord.NULL |
Constructor and Description |
---|
DirectCollectionChangeRecord()
This default constructor.
|
DirectCollectionChangeRecord(ObjectChangeSet owner)
This constructor returns a changeRecord representing the DirectCollection mapping.
|
Modifier and Type | Method and Description |
---|---|
void |
addAdditionChange(java.util.HashMap additions,
java.util.HashMap databaseCount)
This method takes a map of primitive objects and adds them to the add list.
|
void |
addAdditionChange(java.lang.Object key,
java.lang.Integer count)
This method takes a single addition value and records it.
|
void |
addRemoveChange(java.util.HashMap additions,
java.util.HashMap databaseCount)
This method takes a hashtable of primitive objects and adds them to the remove list.
|
void |
addRemoveChange(java.lang.Object key,
java.lang.Integer count)
This method takes a single remove change and integrates it with this changeset.
|
void |
clearChanges()
Clears info about added / removed objects set by change tracker.
|
void |
decrementDatabaseCount(java.lang.Object object)
Decrement the count for object
|
java.util.Vector |
getAddObjectList()
ADVANCED:
This method returns the list of added objects.
|
java.util.HashMap |
getAddObjectMap()
This method returns the collection of objects that were added to the collection.
|
java.util.Map |
getChangedIndexes() |
java.util.HashMap |
getCommitAddMap()
This method returns the collection of objects that were added to the collection.
|
int |
getNewSize() |
int |
getOldSize() |
java.util.Vector |
getRemoveObjectList()
ADVANCED:
This method returns the list of removed objects.
|
java.util.HashMap |
getRemoveObjectMap()
This method returns the collection of objects that were removed from the collection.
|
boolean |
hasChanges()
Returns true if the change set has changes.
|
void |
incrementDatabaseCount(java.lang.Object object)
Increment the count for object
|
void |
internalRecreateOriginalCollection(java.lang.Object currentCollection,
AbstractSession session)
Recreates the original state of the collection.
|
boolean |
isFirstToAddAlreadyInCollection() |
boolean |
isFirstToRemoveAlreadyOutCollection() |
void |
mergeRecord(ChangeRecord mergeFromRecord,
UnitOfWorkChangeSet mergeToChangeSet,
UnitOfWorkChangeSet mergeFromChangeSet)
This method will be used to merge one record into another.
|
boolean |
orderHasBeenRepaired() |
void |
setChangedIndexes(java.util.Map changedIndexes) |
void |
setCommitAddition(java.util.Hashtable additions)
This method takes a hashtable of primitives and adds them to the commit list.
|
void |
setFirstToAddAlreadyInCollection(boolean flag) |
void |
setFirstToRemoveAlreadyOutCollection(boolean flag) |
void |
setNewSize(int size) |
void |
setOldSize(int size) |
void |
setOrderHasBeenRepaired(boolean hasBeenRepaired) |
void |
storeDatabaseCounts(java.lang.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.
|
void |
updateReferences(UnitOfWorkChangeSet mergeToChangeSet,
UnitOfWorkChangeSet mergeFromChangeSet)
This method will be used to update the objectsChangeSets references
|
getLatestCollection, getOldValue, getOldValue, getOriginalCollection, isDeferred, recreateOriginalCollection, setIsDeferred, setLatestCollection, setOriginalCollection
getAttribute, getMapping, getOwner, prepareForSynchronization, setAttribute, setMapping, setOwner, toString, updateChangeRecordWithNewValue
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getAttribute, getOldValue, getOwner
public DirectCollectionChangeRecord()
public DirectCollectionChangeRecord(ObjectChangeSet owner)
public void addAdditionChange(java.util.HashMap additions, java.util.HashMap databaseCount)
public void addAdditionChange(java.lang.Object key, java.lang.Integer count)
public void addRemoveChange(java.util.HashMap additions, java.util.HashMap databaseCount)
public void addRemoveChange(java.lang.Object key, java.lang.Integer count)
public void setCommitAddition(java.util.Hashtable additions)
public void storeDatabaseCounts(java.lang.Object collection, ContainerPolicy containerPolicy, AbstractSession session)
public void incrementDatabaseCount(java.lang.Object object)
public void decrementDatabaseCount(java.lang.Object object)
public java.util.Vector getAddObjectList()
getAddObjectList
in interface DirectCollectionChangeRecord
public java.util.HashMap getAddObjectMap()
public java.util.HashMap getCommitAddMap()
public java.util.Vector getRemoveObjectList()
getRemoveObjectList
in interface DirectCollectionChangeRecord
public java.util.HashMap getRemoveObjectMap()
public boolean hasChanges()
public void mergeRecord(ChangeRecord mergeFromRecord, UnitOfWorkChangeSet mergeToChangeSet, UnitOfWorkChangeSet mergeFromChangeSet)
mergeRecord
in class ChangeRecord
public void updateReferences(UnitOfWorkChangeSet mergeToChangeSet, UnitOfWorkChangeSet mergeFromChangeSet)
updateReferences
in class ChangeRecord
public void setFirstToAddAlreadyInCollection(boolean flag)
public boolean isFirstToAddAlreadyInCollection()
public void setFirstToRemoveAlreadyOutCollection(boolean flag)
public boolean isFirstToRemoveAlreadyOutCollection()
public void setChangedIndexes(java.util.Map changedIndexes)
public java.util.Map getChangedIndexes()
public void setOldSize(int size)
public int getOldSize()
public void setNewSize(int size)
public int getNewSize()
public void internalRecreateOriginalCollection(java.lang.Object currentCollection, AbstractSession session)
internalRecreateOriginalCollection
in class DeferrableChangeRecord
public void setOrderHasBeenRepaired(boolean hasBeenRepaired)
public boolean orderHasBeenRepaired()
public void clearChanges()
clearChanges
in class DeferrableChangeRecord
EclipseLink 2.6.3, "build v20160428-59c81c5" API Reference