public interface MutableAggregateChange<T> extends AggregateChange<T>
AggregateChange.Kind
Modifier and Type | Method and Description |
---|---|
void |
addAction(DbAction<?> action)
Adds an action to this
AggregateChange . |
static <T> MutableAggregateChange<T> |
forDelete(Class<T> entityClass,
T entity)
Factory method to create an
MutableAggregateChange for deleting entities. |
static <T> MutableAggregateChange<T> |
forDelete(Class<T> entityClass,
T entity,
Number previousVersion)
Factory method to create an
MutableAggregateChange for deleting entities. |
static <T> MutableAggregateChange<T> |
forDelete(T entity)
Factory method to create an
MutableAggregateChange for deleting entities. |
static <T> MutableAggregateChange<T> |
forSave(T entity)
Factory method to create an
MutableAggregateChange for saving entities. |
static <T> MutableAggregateChange<T> |
forSave(T entity,
Number previousVersion)
Factory method to create an
MutableAggregateChange for saving entities. |
Number |
getPreviousVersion() |
void |
setEntity(T aggregateRoot)
Set the root object of the
AggregateChange . |
forEachAction, getEntity, getEntityType, getKind
static <T> MutableAggregateChange<T> forSave(T entity)
MutableAggregateChange
for saving entities.T
- entity type.entity
- aggregate root to save.MutableAggregateChange
for saving the root entity
.static <T> MutableAggregateChange<T> forSave(T entity, @Nullable Number previousVersion)
MutableAggregateChange
for saving entities.T
- entity type.entity
- aggregate root to save.previousVersion
- the previous version assigned to the instance being saved. May be null.MutableAggregateChange
for saving the root entity
.static <T> MutableAggregateChange<T> forDelete(T entity)
MutableAggregateChange
for deleting entities.T
- entity type.entity
- aggregate root to delete.MutableAggregateChange
for deleting the root entity
.static <T> MutableAggregateChange<T> forDelete(Class<T> entityClass, @Nullable T entity)
MutableAggregateChange
for deleting entities.T
- entity type.entityClass
- aggregate root type.entity
- aggregate root to delete.MutableAggregateChange
for deleting the root entity
.static <T> MutableAggregateChange<T> forDelete(Class<T> entityClass, @Nullable T entity, @Nullable Number previousVersion)
MutableAggregateChange
for deleting entities.T
- entity type.entityClass
- aggregate root type.entity
- aggregate root to delete.previousVersion
- the previous version assigned to the instance being saved. May be null.MutableAggregateChange
for deleting the root entity
.void addAction(DbAction<?> action)
AggregateChange
.action
- must not be null.void setEntity(@Nullable T aggregateRoot)
AggregateChange
.aggregateRoot
- may be null if the change refers to a list of aggregates or references it by id.Copyright © 2017–2022 Pivotal Software, Inc.. All rights reserved.