Skip to content

Commit

Permalink
Document event publication from repository delete methods in `Abstrac…
Browse files Browse the repository at this point in the history
…tAggregateRoot`.

Added additional comment regarding registerEvent and andEvent in AbstractAggregateRoot.

Closes: #2903
  • Loading branch information
shin-mallang authored and mp911de committed Aug 16, 2023
1 parent 45c8cb9 commit 3145a09
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class AbstractAggregateRoot<A extends AbstractAggregateRoot<A>> {
private transient final @Transient List<Object> 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.
Expand Down Expand Up @@ -86,7 +86,8 @@ protected final A andEventsFrom(A aggregate) {
}

/**
* 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}.
Expand Down

0 comments on commit 3145a09

Please sign in to comment.