diff --git a/bookstore/src/main/java/com/fjordtek/bookstore/model/book/BookRepositoryCustom.java b/bookstore/src/main/java/com/fjordtek/bookstore/model/book/BookRepositoryCustom.java index a8ce905..d88cae7 100644 --- a/bookstore/src/main/java/com/fjordtek/bookstore/model/book/BookRepositoryCustom.java +++ b/bookstore/src/main/java/com/fjordtek/bookstore/model/book/BookRepositoryCustom.java @@ -9,7 +9,7 @@ import java.util.List; public interface BookRepositoryCustom { - void updateWithoutPrice(Book book); + void updateWithoutPriceAndWithoutPublish(Book book); List findAllPublished(); } \ No newline at end of file diff --git a/bookstore/src/main/java/com/fjordtek/bookstore/model/book/BookRepositoryImpl.java b/bookstore/src/main/java/com/fjordtek/bookstore/model/book/BookRepositoryImpl.java index e2d248a..c45db30 100644 --- a/bookstore/src/main/java/com/fjordtek/bookstore/model/book/BookRepositoryImpl.java +++ b/bookstore/src/main/java/com/fjordtek/bookstore/model/book/BookRepositoryImpl.java @@ -25,7 +25,7 @@ public class BookRepositoryImpl implements BookRepositoryCustom { * Hibernate takes care of entityManager transactions (begin, commit, rollback, close, etc.) */ @Override - public void updateWithoutPrice(Book book) { + public void updateWithoutPriceAndWithoutPublish(Book book) { try { diff --git a/bookstore/src/main/java/com/fjordtek/bookstore/web/BookController.java b/bookstore/src/main/java/com/fjordtek/bookstore/web/BookController.java index 22eae35..d207808 100644 --- a/bookstore/src/main/java/com/fjordtek/bookstore/web/BookController.java +++ b/bookstore/src/main/java/com/fjordtek/bookstore/web/BookController.java @@ -354,7 +354,7 @@ public class BookController { bookAuthorHelper.detectAndSaveUpdateAuthorForBook(book); if (book.getPrice() == null) { - bookRepository.updateWithoutPrice(book); + bookRepository.updateWithoutPriceAndWithoutPublish(book); } else { bookRepository.save(book); }