Advertisement
Guest User

Untitled

a guest
Nov 18th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. public interface BookRepository extends CrudRepository<Book, Integer> {
  2.  
  3. @Query("select a from Book a where (a.title=:title or :title is null) AND (a.author=:author or :author is null) AND (a.category=:category or :category is null)")
  4. List<Book> findBooksByTitleAndAuthorAndCategory(@Param("title") String titleID,@Param("author") String authorID,@Param("category") String categoryID);
  5. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement