Interface MutableAggregateChange<T>

All Superinterfaces:
AggregateChange<T>
All Known Subinterfaces:
RootAggregateChange<T>
All Known Implementing Classes:
DeleteAggregateChange

public interface MutableAggregateChange<T> extends AggregateChange<T>
Represents the change happening to the aggregate (as used in the context of Domain Driven Design) as a whole.
Since:
2.0
Author:
Jens Schauder, Mark Paluch, Chirag Tailor
  • Method Details

    • forSave

      static <T> RootAggregateChange<T> forSave(T entity)
      Factory method to create a RootAggregateChange for saving entities.
      Type Parameters:
      T - entity type.
      Parameters:
      entity - aggregate root to save.
      Returns:
      the RootAggregateChange for saving the root entity.
      Since:
      1.2
    • forSave

      static <T> RootAggregateChange<T> forSave(T entity, @Nullable Number previousVersion)
      Factory method to create a RootAggregateChange for saving entities.
      Type Parameters:
      T - entity type.
      Parameters:
      entity - aggregate root to save.
      previousVersion - the previous version assigned to the instance being saved. May be null.
      Returns:
      the RootAggregateChange for saving the root entity.
      Since:
      2.4
    • forDelete

      static <T> DeleteAggregateChange<T> forDelete(T entity)
      Factory method to create a DeleteAggregateChange for deleting entities.
      Type Parameters:
      T - entity type.
      Parameters:
      entity - aggregate root to delete.
      Returns:
      the DeleteAggregateChange for deleting the root entity.
      Since:
      1.2
    • forDelete

      static <T> DeleteAggregateChange<T> forDelete(Class<T> entityClass)
      Factory method to create a DeleteAggregateChange for deleting entities.
      Type Parameters:
      T - entity type.
      Parameters:
      entityClass - aggregate root type.
      Returns:
      the DeleteAggregateChange for deleting the root entity.
      Since:
      1.2
    • forDelete

      static <T> DeleteAggregateChange<T> forDelete(Class<T> entityClass, @Nullable Number previousVersion)
      Factory method to create a DeleteAggregateChange for deleting entities.
      Type Parameters:
      T - entity type.
      Parameters:
      entityClass - aggregate root type.
      previousVersion - the previous version assigned to the instance being saved. May be null.
      Returns:
      the DeleteAggregateChange for deleting the root entity.
      Since:
      2.4
    • addAction

      void addAction(DbAction<?> action)
      Adds an action to this AggregateChange.
      Parameters:
      action - must not be null.
    • getPreviousVersion

      @Nullable Number getPreviousVersion()