EclipseLink 1.1.1_ 1.1.1.v20090430-r4097 API Reference

org.eclipse.persistence.descriptors.changetracking
Class AttributeChangeTrackingPolicy

java.lang.Object
  extended by org.eclipse.persistence.descriptors.changetracking.DeferredChangeDetectionPolicy
      extended by org.eclipse.persistence.descriptors.changetracking.ObjectChangeTrackingPolicy
          extended by 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.

See Also:
DeferredChangeDetectionPolicy, ObjectChangeTrackingPolicy, ChangeTracker, Serialized Form

Constructor Summary
AttributeChangeTrackingPolicy()
           
 
Method Summary
 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
 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.
 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
 boolean isAttributeChangeTrackingPolicy()
          Used to track instances of the change policies without doing an instance of check
 void revertChanges(java.lang.Object clone, ClassDescriptor descriptor, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, java.util.Map cloneMapping)
          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 object
 java.beans.PropertyChangeListener setChangeListener(java.lang.Object clone, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, ClassDescriptor descriptor)
          INTERNAL: Assign AttributeChangeListener to PropertyChangeListener
 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
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributeChangeTrackingPolicy

public AttributeChangeTrackingPolicy()
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 interface ObjectChangePolicy
Overrides:
calculateChangesForExistingObject in class DeferredChangeDetectionPolicy
Parameters:
clone - the Object to compute a change set for
changeSet - the change set to add changes to
descriptor - the descriptor for this object
shouldRaiseEvent - 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 class DeferredChangeDetectionPolicy

isAttributeChangeTrackingPolicy

public boolean isAttributeChangeTrackingPolicy()
Used to track instances of the change policies without doing an instance of check

Specified by:
isAttributeChangeTrackingPolicy in interface ObjectChangePolicy
Overrides:
isAttributeChangeTrackingPolicy in class DeferredChangeDetectionPolicy

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 interface ObjectChangePolicy
Overrides:
updateWithChanges in class DeferredChangeDetectionPolicy

revertChanges

public void revertChanges(java.lang.Object clone,
                          ClassDescriptor descriptor,
                          org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow,
                          java.util.Map cloneMapping)
INTERNAL: Clear the change set in the change event listener.

Specified by:
revertChanges in interface ObjectChangePolicy
Overrides:
revertChanges in class DeferredChangeDetectionPolicy
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 interface ObjectChangePolicy
Overrides:
setAggregateChangeListener in class ObjectChangeTrackingPolicy

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 interface ObjectChangePolicy
Overrides:
setChangeListener in class ObjectChangeTrackingPolicy

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 interface ObjectChangePolicy
Overrides:
setChangeSetOnListener in class DeferredChangeDetectionPolicy

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 interface ObjectChangePolicy
Overrides:
buildBackupClone in class DeferredChangeDetectionPolicy

EclipseLink 1.1.1_ 1.1.1.v20090430-r4097 API Reference