From 8aff63103230780e319a34a5b95dd67cd7c90092 Mon Sep 17 00:00:00 2001 From: Oliver Drotbohm Date: Wed, 14 Jun 2023 16:06:25 +0200 Subject: [PATCH] Improve reference documentation on repository methods triggering event publication. Fixes #2855. --- src/main/asciidoc/repositories.adoc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/asciidoc/repositories.adoc b/src/main/asciidoc/repositories.adoc index 6a837fe8a..3510c6615 100644 --- a/src/main/asciidoc/repositories.adoc +++ b/src/main/asciidoc/repositories.adoc @@ -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