Class 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 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, 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 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 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 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
        unitOfWork - the current session
        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
      • 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 interface ObjectChangePolicy
        Overrides:
        updateListenerForSelfMerge in class DeferredChangeDetectionPolicy
      • 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 interface ObjectChangePolicy
        Overrides:
        revertChanges in class DeferredChangeDetectionPolicy
        cloneMapping - may not be the same as what is in the uow