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 75fd83f..cf5644f 100644 --- a/src/main/java/ussum/homepage/infra/jpa/post/PostRepositoryImpl.java +++ b/src/main/java/ussum/homepage/infra/jpa/post/PostRepositoryImpl.java @@ -210,14 +210,13 @@ public Page findAllByBoardIdAndGroupCodeAndMemberCode(Long boardId, GroupC .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()),