Module spring.data.relational
Interface AfterSaveCallback<T>
- All Superinterfaces:
EntityCallback<T>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
An
EntityCallback that gets invoked after an aggregate was saved to the database.
The persisting process works as follows:
- A decision is made, if the aggregate is new and therefore should be inserted or if it is not new and therefore should be updated.
BeforeConvertCallbackandBeforeConvertEventget published.- An
AggregateChangeobject is created for the aggregate. It includes theDbActioninstances to be executed. This means that all the deletes, updates and inserts to be performed are determined. These actions reference entities of the aggregates in order to access values to be used in the SQL statements. This step also determines if the id of an entity gets passed to the database or if the database is expected to generate that id. BeforeSaveCallbackandBeforeSaveEventget published.- SQL statements get applied to the database.
AfterSaveCallbackandAfterSaveEventget published.
- Since:
- 1.1
- Author:
- Jens Schauder, Mark Paluch
-
Method Summary
Modifier and TypeMethodDescriptiononAfterSave(T aggregate) Entity callback method invoked after an aggregate root was persisted.
-
Method Details
-
onAfterSave
Entity callback method invoked after an aggregate root was persisted. Can return either the same or a modified instance of the aggregate.- Parameters:
aggregate- the saved aggregate.- Returns:
- the saved aggregate.
-