refactor(book-api): drop redundant library joins from UserBookFileProgressRepository (#1414)

This commit is contained in:
brios
2026-05-20 19:33:32 +02:00
committed by GitHub
parent 1e763b1e89
commit 9b28306abd
@@ -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