Skip to content

Commit

Permalink
[hotfix] 페이징 중복 문제 해결, countDistinct
Browse files Browse the repository at this point in the history
  • Loading branch information
chahyunsoo committed Oct 28, 2024
1 parent 5789ab5 commit b0613e6
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -481,14 +481,13 @@ public Page<Post> searchAllByBoardIdAndGroupCodeAndMemberCode(Long boardId, Stri
.fetch();

JPAQuery<Long> countQuery = queryFactory
.select(postEntity.count())
.select(postEntity.countDistinct())
.from(postEntity)
.leftJoin(postEntity.userEntity, userEntity)
.leftJoin(memberEntity).on(memberEntity.userEntity.eq(userEntity))
.leftJoin(memberEntity.groupEntity, groupEntity)
.leftJoin(postFileEntity).on(postFileEntity.postEntity.eq(postEntity))
.where(whereClause)
.distinct();
.where(whereClause);

return PageableExecutionUtils.getPage(
content.stream().map(postMapper::toDomain).collect(Collectors.toList()),
Expand Down

0 comments on commit b0613e6

Please sign in to comment.