Class ObjectChangeTrackingPolicy
- java.lang.Object
-
- org.eclipse.persistence.descriptors.changetracking.DeferredChangeDetectionPolicy
-
- org.eclipse.persistence.descriptors.changetracking.ObjectChangeTrackingPolicy
-
- All Implemented Interfaces:
java.io.Serializable
,ObjectChangePolicy
- Direct Known Subclasses:
AttributeChangeTrackingPolicy
public class ObjectChangeTrackingPolicy extends DeferredChangeDetectionPolicy
PUBLIC: A ObjectChangeTrackingPolicy allows an object to calculate for itself whether it should has changed by implementing ChangeTracker. Changed objects 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 ObjectChangeTrackingPolicy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearChanges(java.lang.Object clone, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, ClassDescriptor descriptor, boolean forRefresh)
INTERNAL: Clear the changes in the ObjectChangeListenervoid
dissableEventProcessing(java.lang.Object changeTracker)
INTERNAL: This method is used to disable changetracking temporarilyvoid
enableEventProcessing(java.lang.Object changeTracker)
INTERNAL: This method is used to enable changetracking temporarilyvoid
initialize(org.eclipse.persistence.internal.sessions.AbstractSession session, ClassDescriptor descriptor)
INTERNAL: initialize the Policyboolean
isDeferredChangeDetectionPolicy()
Used to track instances of the change policies without doing an instance of checkboolean
isObjectChangeTrackingPolicy()
Used to track instances of the change policies without doing an instance of checkvoid
raiseInternalPropertyChangeEvent(java.lang.Object source, java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
INTERNAL: This may cause a property change event to be raised to a listner in the case that a listener exists.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 ObjectChangeListener to PropertyChangeListenerboolean
shouldCompareExistingObjectForChange(java.lang.Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork, ClassDescriptor descriptor)
INTERNAL: Return true if the Object should be compared, false otherwise.-
Methods inherited from class org.eclipse.persistence.descriptors.changetracking.DeferredChangeDetectionPolicy
buildBackupClone, calculateChanges, calculateChangesForExistingObject, calculateChangesForNewObject, createObjectChangeSet, createObjectChangeSetThroughComparison, isAttributeChangeTrackingPolicy, revertChanges, setChangeSetOnListener, updateListenerForSelfMerge, updateWithChanges
-
-
-
-
Method Detail
-
dissableEventProcessing
public void dissableEventProcessing(java.lang.Object changeTracker)
INTERNAL: This method is used to disable changetracking temporarily- Specified by:
dissableEventProcessing
in interfaceObjectChangePolicy
- Overrides:
dissableEventProcessing
in classDeferredChangeDetectionPolicy
-
enableEventProcessing
public void enableEventProcessing(java.lang.Object changeTracker)
INTERNAL: This method is used to enable changetracking temporarily- Specified by:
enableEventProcessing
in interfaceObjectChangePolicy
- Overrides:
enableEventProcessing
in classDeferredChangeDetectionPolicy
-
shouldCompareExistingObjectForChange
public boolean shouldCompareExistingObjectForChange(java.lang.Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork, ClassDescriptor descriptor)
INTERNAL: Return true if the Object should be compared, false otherwise. In ObjectChangeTrackingPolicy or AttributeChangeTracking Policy this method will return true if the object is new, if the object is in the OptimisticReadLock list or if the listener.hasChanges() returns true.- Specified by:
shouldCompareExistingObjectForChange
in interfaceObjectChangePolicy
- Overrides:
shouldCompareExistingObjectForChange
in classDeferredChangeDetectionPolicy
- Parameters:
object
- the object that will be comparedunitOfWork
- the active unitOfWorkdescriptor
- the descriptor for the current object
-
raiseInternalPropertyChangeEvent
public void raiseInternalPropertyChangeEvent(java.lang.Object source, java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
INTERNAL: This may cause a property change event to be raised to a listner in the case that a listener exists. If there is no listener then this call is a no-op- Specified by:
raiseInternalPropertyChangeEvent
in interfaceObjectChangePolicy
- Overrides:
raiseInternalPropertyChangeEvent
in classDeferredChangeDetectionPolicy
-
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 classDeferredChangeDetectionPolicy
-
setChangeListener
public java.beans.PropertyChangeListener setChangeListener(java.lang.Object clone, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, ClassDescriptor descriptor)
INTERNAL: Assign ObjectChangeListener to PropertyChangeListener- Specified by:
setChangeListener
in interfaceObjectChangePolicy
- Overrides:
setChangeListener
in classDeferredChangeDetectionPolicy
-
clearChanges
public void clearChanges(java.lang.Object clone, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, ClassDescriptor descriptor, boolean forRefresh)
INTERNAL: Clear the changes in the ObjectChangeListener- Specified by:
clearChanges
in interfaceObjectChangePolicy
- Overrides:
clearChanges
in classDeferredChangeDetectionPolicy
-
initialize
public void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session, ClassDescriptor descriptor)
INTERNAL: initialize the Policy- Specified by:
initialize
in interfaceObjectChangePolicy
- Overrides:
initialize
in classDeferredChangeDetectionPolicy
-
isDeferredChangeDetectionPolicy
public boolean isDeferredChangeDetectionPolicy()
Used to track instances of the change policies without doing an instance of check- Specified by:
isDeferredChangeDetectionPolicy
in interfaceObjectChangePolicy
- Overrides:
isDeferredChangeDetectionPolicy
in classDeferredChangeDetectionPolicy
-
isObjectChangeTrackingPolicy
public boolean isObjectChangeTrackingPolicy()
Used to track instances of the change policies without doing an instance of check- Specified by:
isObjectChangeTrackingPolicy
in interfaceObjectChangePolicy
- Overrides:
isObjectChangeTrackingPolicy
in classDeferredChangeDetectionPolicy
-
-