From b0613e64819554b9750c963950770f0921724dca Mon Sep 17 00:00:00 2001 From: chahyunsoo Date: Tue, 29 Oct 2024 04:41:12 +0900 Subject: [PATCH] =?UTF-8?q?[hotfix]=20=ED=8E=98=EC=9D=B4=EC=A7=95=20?= =?UTF-8?q?=EC=A4=91=EB=B3=B5=20=EB=AC=B8=EC=A0=9C=20=ED=95=B4=EA=B2=B0,?= =?UTF-8?q?=20countDistinct?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ussum/homepage/infra/jpa/post/PostRepositoryImpl.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/ussum/homepage/infra/jpa/post/PostRepositoryImpl.java b/src/main/java/ussum/homepage/infra/jpa/post/PostRepositoryImpl.java index e44db2a9..75fd83f1 100644 --- a/src/main/java/ussum/homepage/infra/jpa/post/PostRepositoryImpl.java +++ b/src/main/java/ussum/homepage/infra/jpa/post/PostRepositoryImpl.java @@ -481,14 +481,13 @@ public Page searchAllByBoardIdAndGroupCodeAndMemberCode(Long boardId, Stri .fetch(); JPAQuery 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()),