public class UnitOfWorkChangeSet extends Object implements Serializable, UnitOfWorkChangeSet
Purpose: This is the overall collection of changes.
Description: It holds all of the object changes and all ObjectChanges, with the same classType and primary keys, referenced in a changeSet should be the same object.
Modifier and Type | Field and Description |
---|---|
protected IdentityHashtable |
aggregateList |
protected IdentityHashtable |
allChangeSets |
protected IdentityHashtable |
cloneToObjectChangeSet |
protected IdentityHashtable |
deletedObjects |
protected boolean |
hasChanges
This attribute is set to true if a changeSet with changes has been added
|
protected boolean |
hasForcedChanges |
protected Hashtable |
newObjectChangeSets |
protected Hashtable |
objectChanges
This is the collection of ObjectChanges held by this ChangeSet
|
protected IdentityHashtable |
objectChangeSetToUOWClone |
Constructor and Description |
---|
UnitOfWorkChangeSet()
INTERNAL:
Create a ChangeSet
|
UnitOfWorkChangeSet(byte[] bytes)
INTERNAL:
Recreate a UnitOfWorkChangeSet that has been converted to a byte array with the
getByteArrayRepresentation() method.
|
Modifier and Type | Method and Description |
---|---|
void |
addDeletedObject(Object object,
AbstractSession session)
INTERNAL:
Add the Deleted object to the changeSet
|
void |
addDeletedObjects(IdentityHashtable deletedObjects,
AbstractSession session)
INTERNAL:
Add the Deleted objects to the changeSet
|
void |
addNewObjectChangeSet(ObjectChangeSet objectChanges,
AbstractSession session)
INTERNAL:
Add to the changes for 'object' object to this changeSet.
|
void |
addObjectChangeSet(ObjectChangeSet objectChanges)
INTERNAL:
Add to the changes for 'object' object to this changeSet.
|
void |
addObjectChangeSetForIdentity(ObjectChangeSet objectChanges,
Object object)
INTERNAL:
Add change records to the lists used to maintain identity.
|
ObjectChangeSet |
findObjectChangeSet(ObjectChangeSet changeSet,
UnitOfWorkChangeSet mergeFromChangeSet)
INTERNAL:
This method can be used find the equivalent changeset within this UnitOfWorkChangeSet
Aggregates, and new objects without primaryKeys from serialized ChangeSets will not be found
Which may result in duplicates, in the UnitOfWorkChangeSet.
|
ObjectChangeSet |
findOrIntegrateObjectChangeSet(ObjectChangeSet tofind,
UnitOfWorkChangeSet mergeFromChangeSet)
INTERNAL:
This method will be used during the merge process to either find an equivalent change set
within this UnitOfWorkChangeSet or integrate that changeset into this UOW ChangeSet
|
protected IdentityHashtable |
getAggregateList()
INTERNAL:
Get the Aggregate list.
|
IdentityHashtable |
getAllChangeSets()
INTERNAL:
This method returns a reference to the collection
|
IdentityHashtable |
getCloneToObjectChangeSet()
INTERNAL:
Get the clone to object change hash table.
|
IdentityHashtable |
getDeletedObjects()
INTERNAL:
This method returns the reference to the deleted objects from the changeSet
|
Hashtable |
getNewObjectChangeSets()
INTERNAL:
This method will return a reference to the new object change set collections
|
Hashtable |
getObjectChanges()
INTERNAL:
Returns the ObjectChanges held by this ChangeSet.
|
ObjectChangeSet |
getObjectChangeSetForClone(Object clone)
ADVANCED:
Get ChangeSet for a particular clone
|
protected IdentityHashtable |
getObjectChangeSetToUOWClone()
INTERNAL:
This method returns a reference to the collection
|
Object |
getUOWCloneForObjectChangeSet(ObjectChangeSet changeSet)
ADVANCED:
This method returns the Clone for a particular changeSet
|
boolean |
hasChanges()
INTERNAL:
Returns true if the Unit Of Work change Set has changes
|
boolean |
hasForcedChanges()
INTERNAL:
Returns true if this uowChangeSet contains an objectChangeSet that has forced
SQL changes.
|
ObjectChangeSet |
mergeObjectChanges(ObjectChangeSet objectChangeSet,
UnitOfWorkChangeSet mergeFromChangeSet)
INTERNAL:
This method will be used to merge a change set into an UnitOfWorkChangeSet
This method returns the local instance of the changeset
|
void |
mergeUnitOfWorkChangeSet(UnitOfWorkChangeSet mergeFromChangeSet,
AbstractSession session,
boolean postCommit)
INTERNAL:
THis method will be used to merge another changeset into this changeset.
|
void |
putNewObjectInChangesList(ObjectChangeSet objectChangeSet,
AbstractSession session)
INTERNAL:
Used to rehash the new objects back into the objectChanges list for serialization
|
void |
removeObjectChangeSet(ObjectChangeSet objectChanges)
INTERNAL:
Add the changed Object's records to the ChangeSet
|
void |
removeObjectChangeSetFromNewList(ObjectChangeSet objectChangeSet,
AbstractSession session)
INTERNAL:
Used to remove a new object from the new objects list once it has been
inserted and added to the objectChangesList
|
protected void |
setCloneToObjectChangeSet(IdentityHashtable newCloneToObjectChangeSet)
INTERNAL:
This method is used to set the hashtable for cloneToObject reference
|
void |
setHasChanges(boolean flag)
INTERNAL:
Set whether the Unit Of Work change Set has changes
|
void |
setInternalAllChangeSets(Vector objectChangeSets)
INTERNAL:
This method take a collection of ObjectChangeSet rebuilds this UOW change set to a ready to merge stage
|
protected void |
setObjectChanges(Hashtable objectChanges)
INTERNAL:
Sets the collection of ObjectChanges in the change Set
|
protected void |
setObjectChangeSetToUOWClone(IdentityHashtable newObjectChangeSetToUOWClone)
INTERNAL:
This method is used to insert a new collection into the UOWChangeSet.
|
protected transient Hashtable objectChanges
protected transient Hashtable newObjectChangeSets
protected transient IdentityHashtable cloneToObjectChangeSet
protected transient IdentityHashtable objectChangeSetToUOWClone
protected IdentityHashtable aggregateList
protected IdentityHashtable allChangeSets
protected IdentityHashtable deletedObjects
protected boolean hasChanges
protected boolean hasForcedChanges
public UnitOfWorkChangeSet()
public UnitOfWorkChangeSet(byte[] bytes) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
public void addDeletedObjects(IdentityHashtable deletedObjects, AbstractSession session)
objectChanges
- prototype.changeset.ObjectChangespublic void addDeletedObject(Object object, AbstractSession session)
objectChanges
- prototype.changeset.ObjectChangespublic void addObjectChangeSet(ObjectChangeSet objectChanges)
objectChanges
- prototype.changeset.ObjectChangesobject
- java.lang.ObjectaddObjectChangeSetForIdentity()
public void addNewObjectChangeSet(ObjectChangeSet objectChanges, AbstractSession session)
objectChanges
- the new object change setaddObjectChangeSetForIdentity()
public ObjectChangeSet findObjectChangeSet(ObjectChangeSet changeSet, UnitOfWorkChangeSet mergeFromChangeSet)
public ObjectChangeSet findOrIntegrateObjectChangeSet(ObjectChangeSet tofind, UnitOfWorkChangeSet mergeFromChangeSet)
public void addObjectChangeSetForIdentity(ObjectChangeSet objectChanges, Object object)
objectChanges
- prototype.changeset.ObjectChangesaddObjectChangeSet()
protected IdentityHashtable getAggregateList()
public IdentityHashtable getAllChangeSets()
getAllChangeSets
in interface UnitOfWorkChangeSet
public IdentityHashtable getCloneToObjectChangeSet()
public IdentityHashtable getDeletedObjects()
getDeletedObjects
in interface UnitOfWorkChangeSet
public Hashtable getObjectChanges()
public ObjectChangeSet getObjectChangeSetForClone(Object clone)
getObjectChangeSetForClone
in interface UnitOfWorkChangeSet
protected IdentityHashtable getObjectChangeSetToUOWClone()
public Object getUOWCloneForObjectChangeSet(ObjectChangeSet changeSet)
getUOWCloneForObjectChangeSet
in interface UnitOfWorkChangeSet
public boolean hasChanges()
hasChanges
in interface UnitOfWorkChangeSet
public void setHasChanges(boolean flag)
public boolean hasForcedChanges()
public ObjectChangeSet mergeObjectChanges(ObjectChangeSet objectChangeSet, UnitOfWorkChangeSet mergeFromChangeSet)
public void mergeUnitOfWorkChangeSet(UnitOfWorkChangeSet mergeFromChangeSet, AbstractSession session, boolean postCommit)
public void putNewObjectInChangesList(ObjectChangeSet objectChangeSet, AbstractSession session)
public void removeObjectChangeSetFromNewList(ObjectChangeSet objectChangeSet, AbstractSession session)
public void removeObjectChangeSet(ObjectChangeSet objectChanges)
objectChanges
- prototype.changeset.ObjectChangesprotected void setCloneToObjectChangeSet(IdentityHashtable newCloneToObjectChangeSet)
newCloneToObjectChangeSet
- oracle.toplink.essentials.internal.helper.IdentityHashtableprotected void setObjectChanges(Hashtable objectChanges)
newValue
- prototype.changeset.ObjectChangesprotected void setObjectChangeSetToUOWClone(IdentityHashtable newObjectChangeSetToUOWClone)
newObjectChangeSetToUOWClone
- oracle.toplink.essentials.internal.helper.IdentityHashtablepublic Hashtable getNewObjectChangeSets()
public void setInternalAllChangeSets(Vector objectChangeSets)
Copyright © 2023. All rights reserved.