public class DirectCollectionChangeRecord extends ChangeRecord 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 seperately
prototype.changeset.DirectToFieldChangeRecord,prototype.changeset.SingleObjectChangeRecord
,
Serialized FormModifier and Type | Class and Description |
---|---|
static class |
DirectCollectionChangeRecord.NULL |
Modifier and Type | Field and Description |
---|---|
protected HashMap |
addObjectMap |
protected HashMap |
commitAddMap |
protected Object |
latestCollection
Used for change tracking when customer sets entire collection
|
static DirectCollectionChangeRecord.NULL |
Null |
protected Object |
originalCollection
Used for change tracking when customer sets entire collection
|
protected HashMap |
removeObjectMap |
attribute, mapping, owner
Constructor and Description |
---|
DirectCollectionChangeRecord()
This defaul constructor is reference internally by SDK XML project to mapp this class
|
DirectCollectionChangeRecord(ObjectChangeSet owner)
This constructor returns a changeRecord representing the DirectCollection mapping
|
Modifier and Type | Method and Description |
---|---|
void |
addAdditionChange(HashMap additions,
HashMap databaseCount)
This method takes a hastable of primitive objects and adds them to the add list.
|
void |
addAdditionChange(Object key,
Integer count)
This method takes a single addition value and records it.
|
void |
addRemoveChange(HashMap additions,
HashMap databaseCount)
This method takes a hashtable of primitive objects and adds them to the remove list.
|
void |
addRemoveChange(Object key,
Integer count)
This method takes a single remove change and integrates it with this changeset
|
Vector |
getAddObjectList()
ADVANCED:
This method returns the list of added objects
|
HashMap |
getAddObjectMap()
ADVANCED:
This method returns the collection of objects that were added to the collection.
|
HashMap |
getCommitAddMap()
ADVANCED:
This method returns the collection of objects 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
|
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
|
Vector |
getRemoveObjectList()
ADVANCED:
This method returns the list of removed objects
|
HashMap |
getRemoveObjectMap()
ADVANCED:
This method returns the collection of objects that were removed from the collection.
|
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(Vector list)
INTERNAL:
This method sets the list of added objects.
|
void |
setCommitAddition(Hashtable additions)
This method takes a hashtable of primitives and adds them to the commit list.
|
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 |
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(Vector list)
INTERNAL:
This method sets the list of added objects.
|
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
|
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 HashMap addObjectMap
protected HashMap removeObjectMap
protected HashMap commitAddMap
protected transient Object originalCollection
protected transient Object latestCollection
public static DirectCollectionChangeRecord.NULL Null
public DirectCollectionChangeRecord()
public DirectCollectionChangeRecord(ObjectChangeSet owner)
owner
- prototype.changeset.ObjectChangeSet that ObjectChangeSet that uses this recordpublic void addAdditionChange(HashMap additions, HashMap databaseCount)
objectChanges
- prototype.changeset.ObjectChangeSetpublic void addAdditionChange(Object key, Integer count)
public void addRemoveChange(HashMap additions, HashMap databaseCount)
objectChanges
- prototype.changeset.ObjectChangeSetpublic void addRemoveChange(Object key, Integer count)
public void setCommitAddition(Hashtable additions)
public void setLatestCollection(Object latestCollection)
public void setOriginalCollection(Object originalCollection)
public void storeDatabaseCounts(Object collection, ContainerPolicy containerPolicy, AbstractSession session)
public Vector getAddObjectList()
getAddObjectList
in interface DirectCollectionChangeRecord
public void setAddObjectList(Vector list)
public HashMap getAddObjectMap()
public HashMap getCommitAddMap()
public Object getLatestCollection()
public Object getOriginalCollection()
public Vector getRemoveObjectList()
getRemoveObjectList
in interface DirectCollectionChangeRecord
public void setRemoveObjectList(Vector list)
public 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
Copyright © 2021. All rights reserved.