@FunctionalInterface public interface BeforeSaveCallback<T> extends EntityCallback<T>
EntityCallback that gets invoked before changes are applied to the database, after the aggregate was
converted to a database change.
Changes to the aggregate are not taken into account to decide whether the change will be an insert or update. Use the
BeforeConvertCallback to change the persistent the entity before being converted.
Currently a BeforeSaveCallback may be used to create an Id for new aggregate roots. This is for backward
compatibility purposes within the 2.x development line. The preferred way to do this is to use a
BeforeConvertCallback or BeforeConvertEvent and beginning with 3.0. this will be the only correct way
to do this.
| Modifier and Type | Method and Description |
|---|---|
T |
onBeforeSave(T aggregate,
MutableAggregateChange<T> aggregateChange)
Entity callback method invoked before an aggregate root is saved.
|
T onBeforeSave(T aggregate, MutableAggregateChange<T> aggregateChange)
MutableAggregateChange contents. This method is called after converting the
aggregate to MutableAggregateChange.aggregate - the aggregate.aggregateChange - the associated MutableAggregateChange.Copyright © 2017–2022 Pivotal Software, Inc.. All rights reserved.