Class AttributeChangeTrackingPolicy
- java.lang.Object
-
- org.eclipse.persistence.descriptors.changetracking.DeferredChangeDetectionPolicy
-
- org.eclipse.persistence.descriptors.changetracking.ObjectChangeTrackingPolicy
-
- org.eclipse.persistence.descriptors.changetracking.AttributeChangeTrackingPolicy
-
- All Implemented Interfaces:
java.io.Serializable
,ObjectChangePolicy
public class AttributeChangeTrackingPolicy extends ObjectChangeTrackingPolicy
PUBLIC: An AttributeChangeTrackingPolicy allows change tracking at the attribute level of an object by implementing ChangeTracker. Objects with changed attributes will be processed in the UnitOfWork commit process to include any changes in the results of the commit. Unchanged objects will be ignored.
-
-
Constructor Summary
Constructors Constructor Description AttributeChangeTrackingPolicy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
buildBackupClone(java.lang.Object clone, org.eclipse.persistence.internal.descriptors.ObjectBuilder builder, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)
INTERNAL: Only build backup cloneorg.eclipse.persistence.internal.sessions.ObjectChangeSet
calculateChangesForExistingObject(java.lang.Object clone, org.eclipse.persistence.internal.sessions.UnitOfWorkChangeSet changeSet, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork, ClassDescriptor descriptor, boolean shouldRaiseEvent)
INTERNAL: PERF: Calculate change for the existing object, avoids check for new since already know.org.eclipse.persistence.internal.sessions.ObjectChangeSet
createObjectChangeSet(java.lang.Object clone, java.lang.Object backUp, org.eclipse.persistence.internal.sessions.UnitOfWorkChangeSet changeSet, boolean isNew, org.eclipse.persistence.internal.sessions.AbstractSession session, ClassDescriptor descriptor)
INTERNAL: Create ObjectChangeSetboolean
isAttributeChangeTrackingPolicy()
Used to track instances of the change policies without doing an instance of checkvoid
revertChanges(java.lang.Object clone, ClassDescriptor descriptor, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, java.util.Map cloneMapping, boolean forRefresh)
INTERNAL: Clear the change set in the change event listener.void
setAggregateChangeListener(java.lang.Object parent, java.lang.Object aggregate, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, ClassDescriptor descriptor, java.lang.String mappingAttribute)
INTERNAL: Assign ChangeListener to an aggregate objectjava.beans.PropertyChangeListener
setChangeListener(java.lang.Object clone, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, ClassDescriptor descriptor)
INTERNAL: Assign AttributeChangeListener to PropertyChangeListenervoid
setChangeSetOnListener(org.eclipse.persistence.internal.sessions.ObjectChangeSet objectChangeSet, java.lang.Object clone)
INTERNAL: Set the ObjectChangeSet on the Listener, initially used for aggregate supportvoid
updateListenerForSelfMerge(org.eclipse.persistence.internal.descriptors.changetracking.ObjectChangeListener listener, ForeignReferenceMapping mapping, java.lang.Object source, java.lang.Object target, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork)
INTERNAL: In cases where a relationship with detached or new entities is merged into itself previous changes may have been recorded for the detached/new entity that need to be updated.void
updateWithChanges(java.lang.Object object, org.eclipse.persistence.internal.sessions.ObjectChangeSet changeSet, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, ClassDescriptor descriptor)
INTERNAL: Clear the change set in the change event listener.-
Methods inherited from class org.eclipse.persistence.descriptors.changetracking.ObjectChangeTrackingPolicy
clearChanges, dissableEventProcessing, enableEventProcessing, initialize, isDeferredChangeDetectionPolicy, isObjectChangeTrackingPolicy, raiseInternalPropertyChangeEvent, shouldCompareExistingObjectForChange
-
Methods inherited from class org.eclipse.persistence.descriptors.changetracking.DeferredChangeDetectionPolicy
calculateChanges, calculateChangesForNewObject, createObjectChangeSetThroughComparison
-
-
-
-
Method Detail
-
calculateChangesForExistingObject
public org.eclipse.persistence.internal.sessions.ObjectChangeSet calculateChangesForExistingObject(java.lang.Object clone, org.eclipse.persistence.internal.sessions.UnitOfWorkChangeSet changeSet, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork, ClassDescriptor descriptor, boolean shouldRaiseEvent)
INTERNAL: PERF: Calculate change for the existing object, avoids check for new since already know. Avoid backup clone, as not used.- Specified by:
calculateChangesForExistingObject
in interfaceObjectChangePolicy
- Overrides:
calculateChangesForExistingObject
in classDeferredChangeDetectionPolicy
- Parameters:
clone
- the Object to compute a change set forchangeSet
- the change set to add changes tounitOfWork
- the current sessiondescriptor
- the descriptor for this objectshouldRaiseEvent
- indicates whether PreUpdate event should be risen (usually true)- Returns:
- ObjectChangeSet an object change set describing the changes to this object
-
createObjectChangeSet
public org.eclipse.persistence.internal.sessions.ObjectChangeSet createObjectChangeSet(java.lang.Object clone, java.lang.Object backUp, org.eclipse.persistence.internal.sessions.UnitOfWorkChangeSet changeSet, boolean isNew, org.eclipse.persistence.internal.sessions.AbstractSession session, ClassDescriptor descriptor)
INTERNAL: Create ObjectChangeSet- Overrides:
createObjectChangeSet
in classDeferredChangeDetectionPolicy
-
isAttributeChangeTrackingPolicy
public boolean isAttributeChangeTrackingPolicy()
Used to track instances of the change policies without doing an instance of check- Specified by:
isAttributeChangeTrackingPolicy
in interfaceObjectChangePolicy
- Overrides:
isAttributeChangeTrackingPolicy
in classDeferredChangeDetectionPolicy
-
updateWithChanges
public void updateWithChanges(java.lang.Object object, org.eclipse.persistence.internal.sessions.ObjectChangeSet changeSet, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, ClassDescriptor descriptor)
INTERNAL: Clear the change set in the change event listener.- Specified by:
updateWithChanges
in interfaceObjectChangePolicy
- Overrides:
updateWithChanges
in classDeferredChangeDetectionPolicy
-
updateListenerForSelfMerge
public void updateListenerForSelfMerge(org.eclipse.persistence.internal.descriptors.changetracking.ObjectChangeListener listener, ForeignReferenceMapping mapping, java.lang.Object source, java.lang.Object target, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork)
INTERNAL: In cases where a relationship with detached or new entities is merged into itself previous changes may have been recorded for the detached/new entity that need to be updated.- Specified by:
updateListenerForSelfMerge
in interfaceObjectChangePolicy
- Overrides:
updateListenerForSelfMerge
in classDeferredChangeDetectionPolicy
-
revertChanges
public void revertChanges(java.lang.Object clone, ClassDescriptor descriptor, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, java.util.Map cloneMapping, boolean forRefresh)
INTERNAL: Clear the change set in the change event listener.- Specified by:
revertChanges
in interfaceObjectChangePolicy
- Overrides:
revertChanges
in classDeferredChangeDetectionPolicy
cloneMapping
- may not be the same as what is in the uow
-
setAggregateChangeListener
public void setAggregateChangeListener(java.lang.Object parent, java.lang.Object aggregate, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, ClassDescriptor descriptor, java.lang.String mappingAttribute)
INTERNAL: Assign ChangeListener to an aggregate object- Specified by:
setAggregateChangeListener
in interfaceObjectChangePolicy
- Overrides:
setAggregateChangeListener
in classObjectChangeTrackingPolicy
-
setChangeListener
public java.beans.PropertyChangeListener setChangeListener(java.lang.Object clone, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, ClassDescriptor descriptor)
INTERNAL: Assign AttributeChangeListener to PropertyChangeListener- Specified by:
setChangeListener
in interfaceObjectChangePolicy
- Overrides:
setChangeListener
in classObjectChangeTrackingPolicy
-
setChangeSetOnListener
public void setChangeSetOnListener(org.eclipse.persistence.internal.sessions.ObjectChangeSet objectChangeSet, java.lang.Object clone)
INTERNAL: Set the ObjectChangeSet on the Listener, initially used for aggregate support- Specified by:
setChangeSetOnListener
in interfaceObjectChangePolicy
- Overrides:
setChangeSetOnListener
in classDeferredChangeDetectionPolicy
-
buildBackupClone
public java.lang.Object buildBackupClone(java.lang.Object clone, org.eclipse.persistence.internal.descriptors.ObjectBuilder builder, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)
INTERNAL: Only build backup clone- Specified by:
buildBackupClone
in interfaceObjectChangePolicy
- Overrides:
buildBackupClone
in classDeferredChangeDetectionPolicy
-
-