Good day. In a working Spring MVC application, I try to configure my own request in an interface that extends the CrudRepository JPA, but the IDE does not accept the request at all. Here is the request itself:
@Query (value = "Select b FROM Books WHERE Books.BOOK_TITLE LIKE ? AND Books.autor LIKE ?", nativeQuery = true) List<Books> listAllBooks(); In response, the IDE emphasizes AND and reports: number expected, got AND. How to fix?
Even if you create a simple query like:
@Query (value = "Select b.autor FROM Books b", nativeQuery = true) List<Books> listAllBooks(); That IDE emphasizes Books and does not define it as an entity.
The application itself is published on github: https://github.com/oleggalimov/books
Help please understand and fix. And most importantly, how is it possible to properly create such requests?
nativeQuery = true, instead of hql, try to remove this parameter - MrFylypenko