From b0ffb1a04699b98120aab1524a0a6d2ba74b3654 Mon Sep 17 00:00:00 2001 From: shin-mallang Date: Wed, 16 Aug 2023 09:32:39 +0900 Subject: [PATCH] Document event publication from repository delete methods in `AbstractAggregateRoot`. Added additional comment regarding registerEvent and andEvent in AbstractAggregateRoot. Closes: #2903 --- .../springframework/data/domain/AbstractAggregateRoot.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/springframework/data/domain/AbstractAggregateRoot.java b/src/main/java/org/springframework/data/domain/AbstractAggregateRoot.java index 7feb4ba15..c24bc974a 100644 --- a/src/main/java/org/springframework/data/domain/AbstractAggregateRoot.java +++ b/src/main/java/org/springframework/data/domain/AbstractAggregateRoot.java @@ -38,7 +38,7 @@ public class AbstractAggregateRoot> { private transient final @Transient List domainEvents = new ArrayList<>(); /** - * Registers the given event object for publication on a call to a Spring Data repository's save methods. + * Registers the given event object for publication on a call to a Spring Data repository's save or delete methods. * * @param event must not be {@literal null}. * @return the event that has been added. @@ -86,7 +86,8 @@ public class AbstractAggregateRoot> { } /** - * Adds the given event to the aggregate for later publication when calling a Spring Data repository's save-method. + * Adds the given event to the aggregate for later publication + * when calling a Spring Data repository's save or delete method. * Does the same as {@link #registerEvent(Object)} but returns the aggregate instead of the event. * * @param event must not be {@literal null}.