diff --git a/Winey-Domain/src/main/java/com/example/wineydomain/tastingNote/repository/TastingNoteRepositoryImpl.java b/Winey-Domain/src/main/java/com/example/wineydomain/tastingNote/repository/TastingNoteRepositoryImpl.java index 4a9df0c..3c43168 100644 --- a/Winey-Domain/src/main/java/com/example/wineydomain/tastingNote/repository/TastingNoteRepositoryImpl.java +++ b/Winey-Domain/src/main/java/com/example/wineydomain/tastingNote/repository/TastingNoteRepositoryImpl.java @@ -103,7 +103,13 @@ public Page findTastingNotesByWine(Wine wine, User user, Integer pa .limit(pageable.getPageSize()) .fetch(); - long total = queryFactory.selectFrom(qTastingNote).fetchCount(); + long total = queryFactory.selectFrom(qTastingNote).where( + qTastingNote.wine.eq(wine) + .and(qTastingNote.isDeleted.eq(false)) + .and(qTastingNote.isPublic.eq(true) + .or(qTastingNote.user.eq(user)) + ) + ).fetchCount(); return new PageImpl<>(results, pageable, total); }