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()),