Module org.eclipse.persistence.core
Class DeferrableChangeRecord
java.lang.Object
org.eclipse.persistence.internal.sessions.ChangeRecord
org.eclipse.persistence.internal.sessions.DeferrableChangeRecord
- All Implemented Interfaces:
Serializable
,ChangeRecord
- Direct Known Subclasses:
CollectionChangeRecord
,DirectCollectionChangeRecord
,DirectMapChangeRecord
Abstract change record for collection type records that allow deferrable change detection.
Used for change tracking when user sets entire collection.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
Defines if this change should be calculated at commit time using the two collections.protected Object
Used for change tracking when user sets entire collection.protected Object
Used for change tracking when user sets entire collection.Fields inherited from class org.eclipse.persistence.internal.sessions.ChangeRecord
attribute, mapping, owner
-
Constructor Summary
ModifierConstructorDescriptionprotected
protected
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
Clears info about added / removed objects set by change tracker.Used for change tracking when user sets entire collection.ADVANCED: If the owning UnitOfWork has shouldChangeRecordKeepOldValue set to true, then return the old value of the attribute represented by this ChangeRecord.getOldValue
(Object currentCollection, AbstractSession session) Used for change tracking when user sets entire collection.abstract void
internalRecreateOriginalCollection
(Object currentCollection, AbstractSession session) Recreates the original state of currentCollection.boolean
Returns if this change should be calculated at commit time using the two collections.void
recreateOriginalCollection
(Object currentCollection, AbstractSession session) Recreates the original state of the collection.void
setIsDeferred
(boolean isDeferred) Sets if this change should be calculated at commit time using the two collections.void
setLatestCollection
(Object latestCollection) Used for change tracking when user sets entire collection.void
setOriginalCollection
(Object originalCollection) Used for change tracking when user sets entire collection.Methods inherited from class org.eclipse.persistence.internal.sessions.ChangeRecord
getAttribute, getMapping, getOwner, mergeRecord, prepareForSynchronization, setAttribute, setMapping, setOwner, toString, updateChangeRecordWithNewValue, updateReferences
-
Field Details
-
originalCollection
Used for change tracking when user sets entire collection. -
latestCollection
Used for change tracking when user sets entire collection. -
isDeferred
protected boolean isDeferredDefines if this change should be calculated at commit time using the two collections. This is used to handle collection replacement.
-
-
Constructor Details
-
DeferrableChangeRecord
protected DeferrableChangeRecord() -
DeferrableChangeRecord
-
-
Method Details
-
isDeferred
public boolean isDeferred()Returns if this change should be calculated at commit time using the two collections. This is used to handle collection replacement. -
setIsDeferred
public void setIsDeferred(boolean isDeferred) Sets if this change should be calculated at commit time using the two collections. This is used to handle collection replacement. -
getLatestCollection
Used for change tracking when user sets entire collection. This is the last collection that was set on the object. -
getOriginalCollection
Used for change tracking when user sets entire collection. This is the original collection that was set on the object when it was cloned. -
setLatestCollection
Used for change tracking when user sets entire collection. This is the last collection that was set on the object. -
setOriginalCollection
Used for change tracking when user sets entire collection. This is the original collection that was set on the object when it was cloned. -
internalRecreateOriginalCollection
public abstract void internalRecreateOriginalCollection(Object currentCollection, AbstractSession session) Recreates the original state of currentCollection. -
clearChanges
public abstract void clearChanges()Clears info about added / removed objects set by change tracker. Called after the change info has been already used for creation of originalCollection. Also called to make sure there is no change info before comparison for change is performed (change info is still in the record after comparison for change is performed and may cause wrong results when the second comparison for change performed on the same change record). -
recreateOriginalCollection
Recreates the original state of the collection. -
getOldValue
ADVANCED: If the owning UnitOfWork has shouldChangeRecordKeepOldValue set to true, then return the old value of the attribute represented by this ChangeRecord. -
getOldValue
-