Skip to content

Commit edc5422

Browse files
ctailor2schauder
authored andcommitted
Update java and reference doc info on lifecycle events/callbacks.
Original pull request #1200
1 parent 664e687 commit edc5422

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

spring-data-relational/src/main/java/org/springframework/data/relational/core/mapping/event/BeforeConvertCallback.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
/**
2121
* An {@link EntityCallback} that gets invoked before the aggregate is converted into a database change. The decision if
22-
* the change will be an insert or update is made before this callback gets called.
22+
* the change will be an insert or update is made after this callback gets called.
2323
*
2424
* @author Jens Schauder
2525
* @author Mark Paluch

spring-data-relational/src/main/java/org/springframework/data/relational/core/mapping/event/BeforeSaveCallback.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ public interface BeforeSaveCallback<T> extends EntityCallback<T> {
3232
/**
3333
* Entity callback method invoked before an aggregate root is saved. Can return either the same or a modified instance
3434
* of the aggregate and can modify {@link MutableAggregateChange} contents. This method is called after converting the
35-
* {@code aggregate} to {@link MutableAggregateChange}. Changes to the aggregate are not taken into account for
36-
* saving. Use the {@link BeforeConvertCallback} to change the persistent the entity before being converted.
35+
* {@code aggregate} to {@link MutableAggregateChange}. Changes to the aggregate are not taken into account to decide
36+
* whether the change will be an insert or update. Use the {@link BeforeConvertCallback} to change the persistent the
37+
* entity before being converted.
3738
*
3839
* @param aggregate the aggregate.
3940
* @param aggregateChange the associated {@link MutableAggregateChange}.

src/main/asciidoc/jdbc.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ When your data base has an auto-increment column for the ID column, the generate
422422
One important constraint is that, after saving an entity, the entity must not be new any more.
423423
Note that whether an entity is new is part of the entity's state.
424424
With auto-increment columns, this happens automatically, because the ID gets set by Spring Data with the value from the ID column.
425-
If you are not using auto-increment columns, you can use a `BeforeSave` listener, which sets the ID of the entity (covered later in this document).
425+
If you are not using auto-increment columns, you can use a `BeforeConvert` listener, which sets the ID of the entity (covered later in this document).
426426

427427
[[jdbc.entity-persistence.optimistic-locking]]
428428
=== Optimistic Locking
@@ -865,7 +865,7 @@ The following table describes the available events:
865865
This is the correct event if you want to set an id programmatically.
866866

867867
| {javadoc-base}/org/springframework/data/relational/core/mapping/event/BeforeSaveEvent.html[`BeforeSaveEvent`]
868-
| Before an aggregate root gets saved (that is, inserted or updated but after the decision about whether if it gets updated or deleted was made).
868+
| Before an aggregate root gets saved (that is, inserted or updated but after the decision about whether if it gets inserted or updated was made).
869869

870870
| {javadoc-base}org/springframework/data/relational/core/mapping/event/AfterSaveEvent.html[`AfterSaveEvent`]
871871
| After an aggregate root gets saved (that is, inserted or updated).
@@ -900,7 +900,7 @@ Spring Data JDBC uses the `EntityCallback` API for its auditing support and reac
900900
This is the correct callback if you want to set an id programmatically.
901901

902902
| {javadoc-base}/org/springframework/data/relational/core/mapping/event/BeforeSaveCallback.html[`BeforeSaveCallback`]
903-
| Before an aggregate root gets saved (that is, inserted or updated but after the decision about whether if it gets updated or deleted was made).
903+
| Before an aggregate root gets saved (that is, inserted or updated but after the decision about whether if it gets inserted or updated was made).
904904

905905
| {javadoc-base}org/springframework/data/relational/core/mapping/event/AfterSaveCallback.html[`AfterSaveCallback`]
906906
| After an aggregate root gets saved (that is, inserted or updated).

0 commit comments

Comments
 (0)