Skip to content

Commit ef9de4e

Browse files
Domain events
1 parent ce734cc commit ef9de4e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

HibernateSpringBootDomainEvents/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
This is a sample application that relies on `AbstractAggregateRoot` and its `registerEvent()` method. We have two entities, `Book` and `BookReview` involved in a lazy-bidirectional association. A new book review is saved in `CHECK` status and a `CheckReviewEvent` is published. This event is responsible to check the review grammar, content, etc and switch the review status from `CHECK` to `ACCEPT` or `REJECT` and send a corresponding e-mail to the reviewer. So, this event is registered before saving the book review in `CHECK` status and is published automatically after we call the `BookReviewRepository.save()` method. After publication, the event is cleared.
66

77
**Key points:**
8-
- the entity that publish events should extend `AbstractAggregateRoot` and provide a method for registering events
8+
- the entity (aggregate root) that publish events should extend `AbstractAggregateRoot` and provide a method for registering events
99
- here, we register a single event (`CheckReviewEvent`), but more can be registered
1010
- event processing take place in `CheckReviewEventProcessor` in an asynchronous manner via `@Async`
1111

0 commit comments

Comments
 (0)