Skip to content

Commit

Permalink
Improve reference documentation on repository methods triggering even…
Browse files Browse the repository at this point in the history
…t publication.

Fixes #2855.
  • Loading branch information
odrotbohm committed Jun 14, 2023
1 parent f9c1ef9 commit 8aff631
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/asciidoc/repositories.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1138,7 +1138,13 @@ It must not take any arguments.
You can use it to potentially clean the list of events to be published (among other uses).
====

The methods are called every time one of a Spring Data repository's `save(…)`, `saveAll(…)`, `delete(…)` or `deleteAll(…)` methods are called.
The methods are called every time one of the following a Spring Data repository methods are called:

* `save(…)`, `saveAll(…)`
* `delete(…)`, `deleteAll(…)`, `deleteAllInBatch(…)`, `deleteInBatch(…)`

Note, that these methods take the aggregate root instances as arguments.
This is why `deleteById(…)` is notably absent, as the implementations might choose to issue a query deleting the instance and thus we would never have access to the aggregate instance in the first place.

[[core.extensions]]
== Spring Data Extensions
Expand Down

0 comments on commit 8aff631

Please sign in to comment.