public class CollectionChangeRecord extends ChangeRecord implements CollectionChangeRecord
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 seperately
prototype.changeset.DirectToFieldChangeRecord,prototype.changeset.SingleObjectChangeRecord
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected IdentityHashtable |
addObjectList
Contains the added values to the collection and their corresponding ChangeSets.
|
protected List |
addOverFlow
Contains a list of extra adds.
|
protected Object |
latestCollection
Used for change tracking when customer sets entire collection
|
protected IdentityHashtable |
orderedAddObjectIndices
Contains the added values index to the collection.
|
protected Vector |
orderedAddObjects
Contains the added values to the collection and their corresponding ChangeSets in order.
|
protected Vector |
orderedRemoveObjectIndices
Contains the removed values index to the collection.
|
protected Hashtable |
orderedRemoveObjects
Contains the removed values to the collection and their corresponding ChangeSets.
|
protected Object |
originalCollection
Used for change tracking when customer sets entire collection
|
protected IdentityHashtable |
removeObjectList
Contains the removed values from the collection and their corresponding ChangeSets.
|
protected Vector |
sdkAddObjects
Contain the same added values as in addObjectList.
|
protected Vector |
sdkRemoveObjects
Contain the same added values as in addObjectList.
|
attribute, mapping, owner
Constructor and Description |
---|
CollectionChangeRecord()
This default constructor is reference internally by SDK XML project to mapp this class
|
CollectionChangeRecord(ObjectChangeSet owner)
Constructor for the ChangeRecord representing a collection mapping
|
Modifier and Type | Method and Description |
---|---|
void |
addAdditionChange(IdentityHashMap objectChanges,
UnitOfWorkChangeSet changeSet,
AbstractSession session)
This method takes a IdentityHashtable of objects, converts these into
ObjectChangeSets.
|
void |
addOrderedAdditionChange(Vector objectChanges,
IdentityHashtable objectChangesIndices,
UnitOfWorkChangeSet changeSet,
AbstractSession session)
INTERNAL:
This method takes a Vector of objects and converts them into
ObjectChangeSets.
|
void |
addOrderedRemoveChange(Vector indicesToRemove,
Hashtable objectChanges,
UnitOfWorkChangeSet changeSet,
AbstractSession session)
INTERNAL:
This method takes a Hashtable of objects and converts them into
ObjectChangeSets.
|
void |
addRemoveChange(IdentityHashMap objectChanges,
UnitOfWorkChangeSet changeSet,
AbstractSession session)
This method takes a IdentityHashtable of objects, converts these into ObjectChangeSets.
|
IdentityHashtable |
getAddObjectList()
ADVANCED:
This method returns the collection of ChangeSets that were added to the collection.
|
Vector |
getAddObjectsForSDK()
INTERNAL:
This method used by SDK mapping that only supports Collection type not IdentityHashtable.
|
List |
getAddOverFlow()
ADVANCED:
This method returns the collection of ChangeSets that were added to the collection.
|
Object |
getLatestCollection()
Used for change tracking when cutomer sets entire collection
This is the last collection that was set on the object
|
Integer |
getOrderedAddObjectIndex(ObjectChangeSet changes)
ADVANCED:
This method returns the index of an object added to the collection.
|
IdentityHashtable |
getOrderedAddObjectIndices()
ADVANCED:
This method returns the collection of ChangeSets that they were
added to the collection.
|
Vector |
getOrderedAddObjects()
ADVANCED:
This method returns the collection of ChangeSets in the order they were
added to the collection.
|
Object |
getOrderedRemoveObject(Integer index)
ADVANCED:
This method returns the index of an object removed from the collection.
|
Vector |
getOrderedRemoveObjectIndices()
ADVANCED:
This method returns the ordered list of indices to remove from the
collection.
|
Hashtable |
getOrderedRemoveObjects()
ADVANCED:
This method returns the collection of ChangeSets of objects removed from
the collection.
|
Object |
getOriginalCollection()
Used for change tracking when cutomer sets entire collection
This is the original collection that was set on the object when it was cloned
|
IdentityHashtable |
getRemoveObjectList()
ADVANCED:
This method returns the IdentityHashtable that contains the removed values from the collection
and their corresponding ChangeSets.
|
Vector |
getRemoveObjectsForSDK()
INTERNAL:
This method used by SDK mapping that only supports Collection type not IdentityHashtable.
|
boolean |
hasChanges()
returns true if the change set has changes
|
void |
mergeRecord(ChangeRecord mergeFromRecord,
UnitOfWorkChangeSet mergeToChangeSet,
UnitOfWorkChangeSet mergeFromChangeSet)
INTERNAL:
This method will be used to merge one record into another
|
void |
setAddObjectList(IdentityHashtable objectChangesList)
Sets the Added objects list
|
void |
setAddObjectsForSDK(Vector addObjects)
INTERNAL:
This method used by SDK mapping that only supports Collection type not IdentityHashtable.
|
void |
setLatestCollection(Object latestCollection)
Used for change tracking when cutomer sets entire collection
This is the last collection that was set on the object
|
void |
setOrderedAddObjectIndices(IdentityHashtable orderedAddObjectIndices)
ADVANCED:
Sets collection of ChangeSets (and their respective index) that they
were added to the collection.
|
void |
setOrderedAddObjects(Vector orderedAddObjects)
ADVANCED:
Sets collection of ChangeSets that they were added to the collection.
|
void |
setOrderedRemoveObjects(Hashtable orderedRemoveObjects)
ADVANCED:
Sets collection of ChangeSets that they were remvoved from the collection.
|
void |
setOriginalCollection(Object originalCollection)
Used for change tracking when cutomer sets entire collection
This is the original collection that was set on the object when it was cloned
|
void |
setRemoveObjectList(IdentityHashtable objectChangesList)
Sets the removed objects list
|
void |
setRemoveObjectsForSDK(Vector removeObjects)
INTERNAL:
This method used by SDK mapping that only supports Collection type not IdentityHashtable.
|
void |
updateReferences(UnitOfWorkChangeSet mergeToChangeSet,
UnitOfWorkChangeSet mergeFromChangeSet)
INTERNAL:
This method will be used to update the objectsChangeSets references
|
getAttribute, getMapping, getOwner, prepareForSynchronization, setAttribute, setMapping, setOwner, toString, updateChangeRecordWithNewValue
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getAttribute, getOwner
protected IdentityHashtable addObjectList
protected transient Vector orderedAddObjects
protected IdentityHashtable orderedAddObjectIndices
protected Hashtable orderedRemoveObjects
protected transient Vector orderedRemoveObjectIndices
protected transient List addOverFlow
protected IdentityHashtable removeObjectList
protected transient Vector sdkAddObjects
protected transient Vector sdkRemoveObjects
protected transient Object originalCollection
protected transient Object latestCollection
public CollectionChangeRecord()
public CollectionChangeRecord(ObjectChangeSet owner)
owner
- prototype.changeset.ObjectChangeSet the changeSet that uses this recordpublic void addAdditionChange(IdentityHashMap objectChanges, UnitOfWorkChangeSet changeSet, AbstractSession session)
objectChanges
- prototype.changeset.ObjectChangeSetpublic void addOrderedAdditionChange(Vector objectChanges, IdentityHashtable objectChangesIndices, UnitOfWorkChangeSet changeSet, AbstractSession session)
public void addOrderedRemoveChange(Vector indicesToRemove, Hashtable objectChanges, UnitOfWorkChangeSet changeSet, AbstractSession session)
public void addRemoveChange(IdentityHashMap objectChanges, UnitOfWorkChangeSet changeSet, AbstractSession session)
objectChanges
- prototype.changeset.ObjectChangeSetpublic IdentityHashtable getAddObjectList()
getAddObjectList
in interface CollectionChangeRecord
public List getAddOverFlow()
public IdentityHashtable getRemoveObjectList()
getRemoveObjectList
in interface CollectionChangeRecord
public boolean hasChanges()
hasChanges
in interface CollectionChangeRecord
public void mergeRecord(ChangeRecord mergeFromRecord, UnitOfWorkChangeSet mergeToChangeSet, UnitOfWorkChangeSet mergeFromChangeSet)
mergeRecord
in class ChangeRecord
public void setAddObjectList(IdentityHashtable objectChangesList)
newValue
- java.util.Vectorpublic void setRemoveObjectList(IdentityHashtable objectChangesList)
newValue
- java.util.Vectorpublic void updateReferences(UnitOfWorkChangeSet mergeToChangeSet, UnitOfWorkChangeSet mergeFromChangeSet)
updateReferences
in class ChangeRecord
public Vector getAddObjectsForSDK()
public void setAddObjectsForSDK(Vector addObjects)
java.util.Vector
- addObjectspublic Vector getRemoveObjectsForSDK()
public void setRemoveObjectsForSDK(Vector removeObjects)
java.util.Vector
- removeObjectspublic Object getLatestCollection()
public Vector getOrderedAddObjects()
public Integer getOrderedAddObjectIndex(ObjectChangeSet changes)
public IdentityHashtable getOrderedAddObjectIndices()
public Vector getOrderedRemoveObjectIndices()
public Object getOrderedRemoveObject(Integer index)
public Hashtable getOrderedRemoveObjects()
public void setLatestCollection(Object latestCollection)
public void setOrderedAddObjectIndices(IdentityHashtable orderedAddObjectIndices)
public void setOrderedAddObjects(Vector orderedAddObjects)
public void setOrderedRemoveObjects(Hashtable orderedRemoveObjects)
public Object getOriginalCollection()
public void setOriginalCollection(Object originalCollection)
Copyright © 2024. All rights reserved.