Interface MutableAggregateChange<T>
- All Superinterfaces:
AggregateChange<T>
- All Known Subinterfaces:
RootAggregateChange<T>
- All Known Implementing Classes:
DeleteAggregateChange
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
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.data.relational.core.conversion.AggregateChange
AggregateChange.Kind
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds an action to thisAggregateChange
.static <T> DeleteAggregateChange<T>
Factory method to create aDeleteAggregateChange
for deleting entities.static <T> DeleteAggregateChange<T>
Factory method to create aDeleteAggregateChange
for deleting entities.static <T> DeleteAggregateChange<T>
forDelete
(T entity) Factory method to create aDeleteAggregateChange
for deleting entities.static <T> RootAggregateChange<T>
forSave
(T entity) Factory method to create aRootAggregateChange
for saving entities.static <T> RootAggregateChange<T>
Factory method to create aRootAggregateChange
for saving entities.Methods inherited from interface org.springframework.data.relational.core.conversion.AggregateChange
forEachAction, getEntityType, getKind
-
Method Details
-
forSave
Factory method to create aRootAggregateChange
for saving entities.- Type Parameters:
T
- entity type.- Parameters:
entity
- aggregate root to save.- Returns:
- the
RootAggregateChange
for saving the rootentity
. - Since:
- 1.2
-
forSave
Factory method to create aRootAggregateChange
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 rootentity
. - Since:
- 2.4
-
forDelete
Factory method to create aDeleteAggregateChange
for deleting entities.- Type Parameters:
T
- entity type.- Parameters:
entity
- aggregate root to delete.- Returns:
- the
DeleteAggregateChange
for deleting the rootentity
. - Since:
- 1.2
-
forDelete
Factory method to create aDeleteAggregateChange
for deleting entities.- Type Parameters:
T
- entity type.- Parameters:
entityClass
- aggregate root type.- Returns:
- the
DeleteAggregateChange
for deleting the rootentity
. - Since:
- 1.2
-
forDelete
static <T> DeleteAggregateChange<T> forDelete(Class<T> entityClass, @Nullable Number previousVersion) Factory method to create aDeleteAggregateChange
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 rootentity
. - Since:
- 2.4
-
addAction
Adds an action to thisAggregateChange
.- Parameters:
action
- must not be null.
-
getPreviousVersion
-