refactor(book-api): drop redundant library joins from UserBookFileProgressRepository (#1414)
This commit is contained in:
@@ -15,7 +15,7 @@ import java.util.Optional;
|
||||
@Repository
|
||||
public interface UserBookFileProgressRepository extends JpaRepository<UserBookFileProgressEntity, Long> {
|
||||
|
||||
@EntityGraph(attributePaths = {"bookFile", "bookFile.book", "bookFile.book.libraryPath", "bookFile.book.library"})
|
||||
@EntityGraph(attributePaths = {"bookFile", "bookFile.book"})
|
||||
Optional<UserBookFileProgressEntity> findByUserIdAndBookFileId(Long userId, Long bookFileId);
|
||||
|
||||
@Query("""
|
||||
@@ -53,7 +53,7 @@ public interface UserBookFileProgressRepository extends JpaRepository<UserBookFi
|
||||
@Param("bookId") Long bookId
|
||||
);
|
||||
|
||||
@EntityGraph(attributePaths = {"bookFile", "bookFile.book", "bookFile.book.libraryPath", "bookFile.book.library"})
|
||||
@EntityGraph(attributePaths = {"bookFile", "bookFile.book"})
|
||||
@Query("""
|
||||
SELECT ubfp FROM UserBookFileProgressEntity ubfp
|
||||
WHERE ubfp.user.id = :userId
|
||||
@@ -64,7 +64,7 @@ public interface UserBookFileProgressRepository extends JpaRepository<UserBookFi
|
||||
@Param("bookIds") Iterable<Long> bookIds
|
||||
);
|
||||
|
||||
@EntityGraph(attributePaths = {"bookFile", "bookFile.book", "bookFile.book.libraryPath", "bookFile.book.library"})
|
||||
@EntityGraph(attributePaths = {"bookFile", "bookFile.book"})
|
||||
@Query("""
|
||||
SELECT ubfp FROM UserBookFileProgressEntity ubfp
|
||||
WHERE ubfp.user.id = :userId
|
||||
|
||||
Reference in New Issue
Block a user