From 8b53fed77a10fb37e14d7607c70d4890cec8481e Mon Sep 17 00:00:00 2001 From: Pekka Helenius Date: Fri, 16 Oct 2020 16:32:12 +0300 Subject: [PATCH] Fix delete queries for MariaDB Signed-off-by: Pekka Helenius --- .../com/fjordtek/bookstore/model/book/BookHashRepository.java | 2 +- .../java/com/fjordtek/bookstore/model/book/BookRepository.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bookstore/src/main/java/com/fjordtek/bookstore/model/book/BookHashRepository.java b/bookstore/src/main/java/com/fjordtek/bookstore/model/book/BookHashRepository.java index 1d5eb72..9274add 100644 --- a/bookstore/src/main/java/com/fjordtek/bookstore/model/book/BookHashRepository.java +++ b/bookstore/src/main/java/com/fjordtek/bookstore/model/book/BookHashRepository.java @@ -34,7 +34,7 @@ public interface BookHashRepository extends CrudRepository { */ @Modifying @Query( - value = "DELETE FROM BOOK_HASH i WHERE i.book_id = :bookid", + value = "DELETE FROM BOOK_HASH WHERE book_id = :bookid", nativeQuery = true ) void deleteByBookId(@Param("bookid") Long bookId); diff --git a/bookstore/src/main/java/com/fjordtek/bookstore/model/book/BookRepository.java b/bookstore/src/main/java/com/fjordtek/bookstore/model/book/BookRepository.java index 4e85048..b677b08 100644 --- a/bookstore/src/main/java/com/fjordtek/bookstore/model/book/BookRepository.java +++ b/bookstore/src/main/java/com/fjordtek/bookstore/model/book/BookRepository.java @@ -57,7 +57,7 @@ public interface BookRepository extends CrudRepository, BookReposito @Override @Modifying @Query( - value = "DELETE FROM Book i WHERE i.id = :id", + value = "DELETE FROM BOOK WHERE id = :id", nativeQuery = true ) void deleteById(@Param("id") Long id);