diff --git a/src/main/java/com/dailyon/snsservice/repository/comment/CommentRepositoryImpl.java b/src/main/java/com/dailyon/snsservice/repository/comment/CommentRepositoryImpl.java index 77175c3..30bddeb 100644 --- a/src/main/java/com/dailyon/snsservice/repository/comment/CommentRepositoryImpl.java +++ b/src/main/java/com/dailyon/snsservice/repository/comment/CommentRepositoryImpl.java @@ -35,9 +35,8 @@ public class CommentRepositoryImpl implements CommentRepository { public Page findAllByPostId(Long postId, Pageable pageable) { JPAQuery indexQuery = jpaQueryFactory - .selectDistinct(comment.id) + .select(comment.id) .from(comment) - .leftJoin(comment.post, post) .where(post.id.eq(postId).and(comment.parent.isNull())) .orderBy(getOrderCondition(pageable.getSort()).toArray(OrderSpecifier[]::new)) .offset(pageable.getOffset()) diff --git a/src/main/java/com/dailyon/snsservice/repository/follow/FollowRepositoryImpl.java b/src/main/java/com/dailyon/snsservice/repository/follow/FollowRepositoryImpl.java index 6e92208..5a59242 100644 --- a/src/main/java/com/dailyon/snsservice/repository/follow/FollowRepositoryImpl.java +++ b/src/main/java/com/dailyon/snsservice/repository/follow/FollowRepositoryImpl.java @@ -68,9 +68,8 @@ public void toggleFollow(Long followerId, List followingIds) { public Page findFollowingsByMemberId(Long memberId, Pageable pageable) { JPAQuery indexQuery = jpaQueryFactory - .selectDistinct(follow.follower.id) + .select(follow.follower.id) .from(follow) - .leftJoin(follow.following) .where(follow.follower.id.eq(memberId)) .orderBy(getOrderCondition(pageable.getSort()).toArray(OrderSpecifier[]::new)) .offset(pageable.getOffset()) @@ -145,8 +144,6 @@ public Page findFollowersByMemberId(Long memberId, Pageable pa long total = countQuery.fetchCount(); return new PageImpl<>(result, pageable, total); - - // return followJpaRepository.findFollowersByMemberId(memberId, pageable); } private List getOrderCondition(Sort sort) {