From cec4117a9e171c4c2e7b9b629d15ef3f9c27a5b6 Mon Sep 17 00:00:00 2001 From: Pekka Helenius Date: Tue, 29 Sep 2020 12:43:33 +0300 Subject: [PATCH] Change comment placement Signed-off-by: Pekka Helenius --- .../bookstore/model/BookEventHandler.java | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/bookstore/src/main/java/com/fjordtek/bookstore/model/BookEventHandler.java b/bookstore/src/main/java/com/fjordtek/bookstore/model/BookEventHandler.java index a309d68..6feba42 100644 --- a/bookstore/src/main/java/com/fjordtek/bookstore/model/BookEventHandler.java +++ b/bookstore/src/main/java/com/fjordtek/bookstore/model/BookEventHandler.java @@ -7,19 +7,6 @@ import org.springframework.data.rest.core.annotation.HandleAfterCreate; import org.springframework.data.rest.core.annotation.RepositoryEventHandler; import org.springframework.stereotype.Component; -/* - * When using REST API to add a new book, we need to add a corresponding - * book hash Id to BOOK_HASH table, as well. - * - * For instance, this is a case with the following alike curl commands: - * curl --request POST --header "Content-Type: application/json" --data - * '{"title":"Bloody Chamber", ...}' http://localhost:8080/api/booklist - * - * Ref: https://docs.spring.io/spring-data/rest/docs/current/reference/html/#events - * https://stackoverflow.com/questions/49504103/override-spring-data-rest-post-method - * https://www.baeldung.com/spring-data-rest-events - */ - @Component @RepositoryEventHandler(Book.class) public class BookEventHandler { @@ -27,6 +14,18 @@ public class BookEventHandler { @Autowired private BookHashRepository bookHashRepository; + /* + * When using REST API to add a new book, we need to add a corresponding + * book hash Id to BOOK_HASH table, as well. + * + * For instance, this is a case with the following alike curl commands: + * curl --request POST --header "Content-Type: application/json" --data + * '{"title":"Bloody Chamber", ...}' http://localhost:8080/api/booklist + * + * Ref: https://docs.spring.io/spring-data/rest/docs/current/reference/html/#events + * https://stackoverflow.com/questions/49504103/override-spring-data-rest-post-method + * https://www.baeldung.com/spring-data-rest-events + */ @HandleAfterCreate public void handleAfterCreate(Book book) { BookHash bookHash = new BookHash();