Purpose: Hold the Records of change for a particular instance of an object.
Description: This class uses the Primary Keys of the Object it represents, and the class.
| Modifier and Type | Class and Description |
|---|---|
| public static class | ObjectChangeSet.ObjectChangeSetComparator
Allow change sets to be compared by changes for batching. |
| Modifier and Type | Field and Description |
|---|---|
| protected transient CacheKey | activeCacheKey
PERF: Cache the session cacheKey during the merge to avoid duplicate lookups. |
| protected transient Map | |
| protected int | cacheSynchronizationType
Used to store the type of cache synchronization used for this object This variable is set just before the change set is serialized. |
| protected List | changes
This is the collection of changes |
| protected String | |
| protected transient Class | |
| protected transient Object | |
| protected transient Set | deferredSet
This is used during attribute level change tracking when a particular change was detected but that change can not be tracked (ie customer set entire collection in object). |
| protected transient ClassDescriptor | descriptor
Cache the descriptor as it is useful and required in some places. |
| protected transient boolean | |
| protected transient boolean | hasCmpPolicyForcedUpdate
For CMP only: indicates that the object should be force updated (whether it has OptimisticLocking or not): getCmpPolicy().getForcedUpdate()==true |
| protected boolean | |
| protected Object | |
| protected Object | |
| protected boolean | |
| protected boolean | isInvalid
Invalid change set shouldn't be merged into object in cache, rather the object should be invalidated |
| protected boolean | |
| public static final int | |
| protected Object | |
| protected Object | |
| protected transient OptimisticLockingPolicy | optimisticLockingPolicy
Used in mergeObjectChanges method for writeLock and initialWriteLock comparison of the merged change sets |
| protected AbstractRecord | |
| protected boolean | |
| protected Boolean | shouldModifyVersionField
Contains optimisticReadLockObject corresponding to the clone, non-null indicates forced changes |
| protected transient boolean | shouldRecalculateAfterUpdateEvent
return whether this change set should be recalculated after an event changes the object |
| protected transient UnitOfWorkChangeSet | unitOfWorkChangeSet
This member variable holds the reference to the parent UnitOfWork Change Set |
| protected Object |
| Access | Constructor and Description |
|---|---|
| public | |
| public | ObjectChangeSet(Object primaryKey, ClassDescriptor descriptor, Object cloneObject, UnitOfWorkChangeSet parent, boolean isNew)
This constructor is used to create an ObjectChangeSet that represents a regular object. |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public int | compareTo(ObjectChangeSet
the object to be compared. changeSet)Implements java. |
| public boolean | Returns: true if this change set should contain all change information, false if only the identity information should be available.INTERNAL: Convenience method used to query this change set after it has been sent by cache synchronization. |
| public void | deferredDetectionRequiredOn(String attributeName)
INTERNAL: This method is used during attribute level change tracking when a particular change was detected but that change can not be tracked (ie customer set entire collection in object). |
| protected void | |
| public boolean | equals(Object
the reference object with which to compare. object)Overrides java. Implements org. |
| public boolean | |
| public CacheKey | |
| public Map | |
| public int | |
| public List | getChangedAttributeNames()
Implements org. |
| public List | getChanges()
Implements org. |
| public ChangeRecord | getChangesForAttributeNamed(String attributeName)
Implements org. |
| public String | getClassName()
Implements org. |
| public Class | Returns: java.lang.Class or null if the class type isn't initialized.INTERNAL: This method returns the class type that this changeSet represents. |
| public Class | getClassType(Session session)
Implements org. |
| public Set | |
| public ClassDescriptor | |
| public Object | getId()
Implements org. |
| public Object | getInitialWriteLockValue()
INTERNAL: This method is used to return the initial lock value of the object this changeSet represents. |
| public Object | getNewKey()
Implements org. |
| protected Object | getObjectForMerge(MergeManager mergeManager, AbstractSession session, Object primaryKey, ClassDescriptor descriptor)
INTERNAL: For use within the distributed merge process, this method will get an object from the shared cache using a readlock. |
| public Object | getOldKey()
Implements org. |
| public Object | |
| public Object | |
| public AbstractRecord | |
| public int | |
| public Object | getTargetVersionOfSourceObject(MergeManager mergeManager, AbstractSession session)
INTERNAL: This method is used to return the complex object specified within the change record. |
| public Object | getTargetVersionOfSourceObject(MergeManager mergeManager, AbstractSession targetSession, boolean
boolean if the object can not be found should it be read in from the database. shouldRead)INTERNAL: This method is used to return the complex object specified within the change record. |
| public Object | |
| public UnitOfWorkChangeSet | getUOWChangeSet()
Implements org. |
| public Object | getWriteLockValue()
Implements org. |
| public boolean | hasChangeFor(String
the name of the attribute to search for. attributeName)Implements org. |
| public boolean | hasChanges()
Implements org. |
| public boolean | |
| public boolean | hasDeferredAttributes()
Check to see if there are any attributes that must be calculated at commit time. |
| public boolean | |
| public boolean | hasForcedChangesFromCascadeLocking()
INTERNAL: Returns true if this particular changeSet has forced SQL changes because of a cascade optimistic locking policy. |
| public int | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | isNew()
Implements org. |
| public void | mergeObjectChanges(ObjectChangeSet changeSetToMergeFrom, UnitOfWorkChangeSet mergeToChangeSet, UnitOfWorkChangeSet mergeFromChangeSet)
INTERNAL: This method will be used to merge changes from a supplied ObjectChangeSet into this changeSet. |
| public void | postSerialize(Object clone, UnitOfWorkChangeSet uowChangeSet, AbstractSession session)
INTERNAL: Reset the change set's transient variables after serialization. |
| public void | readCompleteChangeSet(ObjectInputStream stream)
INTERNAL: Helper method used by readObject to read a completely serialized change set from the stream. |
| public void | readIdentityInformation(ObjectInputStream stream)
INTERNAL: Helper method used by readObject to read just the information about object identity from a serialized stream. |
| private void | |
| protected void | rebuildWriteLockValueFromUserFormat(ClassDescriptor descriptor, AbstractSession session)
Rebuild writeLockValue to the expected type from user format i.e XML change set has all values as String. |
| public void | |
| protected void | removeFromIdentityMap(AbstractSession session)
Remove object represent this change set from identity map. |
| public void | setActiveCacheKey(CacheKey activeCacheKey)
INTERNAL: PERF: Set the session cache-key, cached during the merge. |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | setHasForcedChangesFromCascadeLocking(boolean newValue)
INTERNAL: Used by calculateChanges to mark this ObjectChangeSet as having to be flushed to the db stemming from a cascade optimistic locking policy. |
| public void | |
| public void | |
| public void | setInitialWriteLockValue(Object initialWriteLockValue)
ADVANCED: This method is used to set the initial writeLock value for an ObjectChangeSet. |
| public void | setIsAggregate(boolean
boolean true if the ChangeSet represents an aggregate isAggregate)INTERNAL: Set if this object change Set represents an aggregate |
| public void | |
| public void | setIsNew(boolean
boolean true if this ChangeSet represents a new object newIsNew)INTERNAL: Set whether this ObjectChanges represents a new Object |
| public void | |
| public void | |
| public void | setOptimisticLockingPolicyAndInitialWriteLockValue(OptimisticLockingPolicy optimisticLockingPolicy, AbstractSession session)
INTERNAL: This method should ONLY be used to set the initial writeLock value for an ObjectChangeSet when it is first built. |
| public void | |
| public void | |
| public void | setShouldModifyVersionField(Boolean shouldModifyVersionField)
INTERNAL: Holds a Boolean indicating whether version field should be modified. |
| public void | setShouldRecalculateAfterUpdateEvent(boolean shouldRecalculateAfterUpdateEvent)
Implements org. |
| public void | |
| public void | setUnitOfWorkClone(Object cloneObject)
INTERNAL: Sets the UnitOfWork Clone that this ChangeSet was built for. |
| public void | setUOWChangeSet(UnitOfWorkChangeSet newUnitOfWorkChangeSet)
INTERNAL: Used to set the parent change Set. |
| public void | setWriteLockValue(Object newWriteLockValue)
ADVANCED: This method is used to set the writeLock value for an ObjectChangeSet Any changes to the write lock value should to through setWriteLockValue(Object obj) so that the change set is marked as being dirty. |
| public boolean | |
| public boolean | shouldInvalidateObject(Object
Object is from session's cache into which the changes are about to be merged, non null. original, AbstractSession AbstractSession into which the changes are about to be merged; session)INTERNAL: Indicates whether the object in session cache should be invalidated. |
| public Boolean | shouldModifyVersionField()
INTERNAL: Holds a Boolean indicating whether version field should be modified. |
| public boolean | shouldRecalculateAfterUpdateEvent()
Implements org. |
| public String | |
| public void | updateChangeRecordForAttribute(String attributeName, Object value)
INTERNAL: Used to update a changeRecord that is stored in the CHangeSet with a new value. |
| public void | updateChangeRecordForAttribute(DatabaseMapping mapping, Object value, AbstractSession session, Object oldValue)
INTERNAL: Used to update a changeRecord that is stored in the CHangeSet with a new value. |
| public void | updateChangeRecordForAttributeWithMappedObject(String attributeName, Object value, AbstractSession session)
ADVANCED: Used to update a changeRecord that is stored in the CHangeSet with a new value. |
| public void | updateReferences(UnitOfWorkChangeSet localChangeSet, UnitOfWorkChangeSet mergingChangeSet)
INTERNAL: This method will be used when merging changesets into other changesets. |
| protected void | |
| public void | |
| public void | |
| private void | writeObject(ObjectOutputStream stream)
INTERNAL: Override the default serialization since different parts of an ObjectChangeSet will be serialized depending on the type of CacheSynchronizationType |