Class ObjectChangeTrackingPolicy
java.lang.Object
org.eclipse.persistence.descriptors.changetracking.DeferredChangeDetectionPolicy
org.eclipse.persistence.descriptors.changetracking.ObjectChangeTrackingPolicy
- All Implemented Interfaces:
Serializable
,ObjectChangePolicy
- Direct Known Subclasses:
AttributeChangeTrackingPolicy
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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clearChanges
(Object clone, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, ClassDescriptor descriptor, boolean forRefresh) INTERNAL: Clear the changes in the ObjectChangeListenervoid
dissableEventProcessing
(Object changeTracker) INTERNAL: This method is used to disable changetracking temporarilyvoid
enableEventProcessing
(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
Used to track instances of the change policies without doing an instance of checkboolean
Used to track instances of the change policies without doing an instance of checkvoid
raiseInternalPropertyChangeEvent
(Object source, String propertyName, Object oldValue, 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
(Object parent, Object aggregate, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, ClassDescriptor descriptor, String mappingAttribute) INTERNAL: Assign ChangeListener to an aggregate objectsetChangeListener
(Object clone, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, ClassDescriptor descriptor) INTERNAL: Assign ObjectChangeListener to PropertyChangeListenerboolean
shouldCompareExistingObjectForChange
(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
-
Constructor Details
-
ObjectChangeTrackingPolicy
public ObjectChangeTrackingPolicy()
-
-
Method Details
-
dissableEventProcessing
INTERNAL: This method is used to disable changetracking temporarily- Specified by:
dissableEventProcessing
in interfaceObjectChangePolicy
- Overrides:
dissableEventProcessing
in classDeferredChangeDetectionPolicy
-
enableEventProcessing
INTERNAL: This method is used to enable changetracking temporarily- Specified by:
enableEventProcessing
in interfaceObjectChangePolicy
- Overrides:
enableEventProcessing
in classDeferredChangeDetectionPolicy
-
shouldCompareExistingObjectForChange
public boolean shouldCompareExistingObjectForChange(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(Object source, String propertyName, Object oldValue, 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(Object parent, Object aggregate, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, ClassDescriptor descriptor, String mappingAttribute) INTERNAL: Assign ChangeListener to an aggregate object- Specified by:
setAggregateChangeListener
in interfaceObjectChangePolicy
- Overrides:
setAggregateChangeListener
in classDeferredChangeDetectionPolicy
-
setChangeListener
public PropertyChangeListener setChangeListener(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(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
-