Interface ObjectChangePolicy

    • Method Detail

      • calculateChangesForNewObject

        ObjectChangeSet calculateChangesForNewObject​(Object clone,
                                                     UnitOfWorkChangeSet changes,
                                                     UnitOfWorkImpl unitOfWork,
                                                     ClassDescriptor descriptor,
                                                     boolean shouldRaiseEvent)
        INTERNAL: CalculateChanges creates a change set for a new object.
        Parameters:
        clone - the Object to compute a change set for
        changes - 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
      • calculateChangesForExistingObject

        ObjectChangeSet calculateChangesForExistingObject​(Object clone,
                                                          UnitOfWorkChangeSet changes,
                                                          UnitOfWorkImpl unitOfWork,
                                                          ClassDescriptor descriptor,
                                                          boolean shouldRaiseEvent)
        INTERNAL: CalculateChanges creates a change set for an existing object.
        Parameters:
        clone - the Object to compute a change set for
        changes - 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
      • calculateChanges

        ObjectChangeSet calculateChanges​(Object clone,
                                         Object backupClone,
                                         boolean isNew,
                                         UnitOfWorkChangeSet changes,
                                         UnitOfWorkImpl unitOfWork,
                                         ClassDescriptor descriptor,
                                         boolean shouldRaiseEvent)
        INTERNAL: CalculateChanges creates a change set for an existing object.
        Parameters:
        clone - the object to compute a change set for
        backupClone - the object used to compute changes from
        isNew - determines if the object is new
        changes - 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
      • updateListenerForSelfMerge

        void updateListenerForSelfMerge​(ObjectChangeListener listener,
                                        ForeignReferenceMapping mapping,
                                        Object source,
                                        Object target,
                                        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.
      • dissableEventProcessing

        void dissableEventProcessing​(Object changeTracker)
        INTERNAL: This method is used to disable changetracking temporarily
      • enableEventProcessing

        void enableEventProcessing​(Object changeTracker)
        INTERNAL: This method is used to enable changetracking temporarily
      • raiseInternalPropertyChangeEvent

        void raiseInternalPropertyChangeEvent​(Object source,
                                              String propertyName,
                                              Object oldValue,
                                              Object newValue)
        INTERNAL: This may cause a property change event to be raised to a listener in the case that a listener exists. If there is no listener then this call is a no-op
      • revertChanges

        void revertChanges​(Object clone,
                           ClassDescriptor descriptor,
                           UnitOfWorkImpl uow,
                           Map cloneMapping,
                           boolean forRefresh)
        INTERNAL: This method is used to revert an object within the unit of work
      • clearChanges

        void clearChanges​(Object object,
                          UnitOfWorkImpl uow,
                          ClassDescriptor descriptor,
                          boolean forRefresh)
        INTERNAL: This is a place holder for reseting the listener on one of the subclasses
      • updateWithChanges

        void updateWithChanges​(Object clone,
                               ObjectChangeSet objectChangeSet,
                               UnitOfWorkImpl uow,
                               ClassDescriptor descriptor)
        INTERNAL: This method is used internally to rest the policies back to original state This is used when the clones are to be reused.
      • shouldCompareExistingObjectForChange

        boolean shouldCompareExistingObjectForChange​(Object object,
                                                     UnitOfWorkImpl unitOfWork,
                                                     ClassDescriptor descriptor)
        INTERNAL: Return true if the Object should be compared, false otherwise. This method is implemented to allow run time determination of whether a change set should be computed for an object. In general, calculateChanges() will only be executed in a UnitOfWork if this method returns true.
        Parameters:
        object - the object that will be compared
        unitOfWork - the active unitOfWork
        descriptor - the descriptor for the current object
      • setChangeSetOnListener

        void setChangeSetOnListener​(ObjectChangeSet objectChangeSet,
                                    Object clone)
        INTERNAL: Set the ObjectChangeSet on the Listener, initially used for aggregate support
      • isDeferredChangeDetectionPolicy

        boolean isDeferredChangeDetectionPolicy()
        Used to track instances of the change policies without doing an instance of check
      • isObjectChangeTrackingPolicy

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

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