Skip to content

Commit

Permalink
deleted extra word
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueVioletTeti committed Oct 9, 2023
1 parent 05a175a commit c9cc807
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@

public interface BookRepository extends JpaRepository<Book, Long> {
@Override
@Query("SELECT DISTINCT b FROM Book b "
@Query("SELECT b FROM Book b "
+ "LEFT JOIN FETCH b.categories")
Page<Book> findAll(Pageable pageable);

@Override
@Query("SELECT DISTINCT b FROM Book b "
@Query("SELECT b FROM Book b "
+ "LEFT JOIN FETCH b.categories WHERE b.id = :categoryId")
Optional<Book> findById(@Param("categoryId") Long categoryId);

@Query("SELECT DISTINCT b FROM Book b "
@Query("SELECT b FROM Book b "
+ "LEFT JOIN FETCH b.categories c WHERE c.id = :categoryId")
List<Book> findAllByCategoryId(@Param("categoryId") Long categoryId);
}

0 comments on commit c9cc807

Please sign in to comment.