From 655d30acfdc892f42096c080dd43e50cd420b763 Mon Sep 17 00:00:00 2001 From: chahyunsoo Date: Thu, 10 Oct 2024 13:48:24 +0900 Subject: [PATCH] =?UTF-8?q?[hotfix]=20groupEntity=EC=99=80=20memberEntity?= =?UTF-8?q?=20=EA=B0=84=20=EC=A1=B0=EC=9D=B8=20=EC=A1=B0=EA=B1=B4=20?= =?UTF-8?q?=EB=AA=85=ED=99=95=ED=9E=88=20=ED=95=98=EC=97=AC=20groupCode=20?= =?UTF-8?q?=EA=B4=80=EB=A0=A8=20=EA=B2=BD=EB=A1=9C=20=ED=91=9C=ED=98=84?= =?UTF-8?q?=EC=8B=9D=20=EC=98=A4=EB=A5=98=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ussum/homepage/infra/jpa/post/PostRepositoryImpl.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 2bb244d..f80ce27 100644 --- a/src/main/java/ussum/homepage/infra/jpa/post/PostRepositoryImpl.java +++ b/src/main/java/ussum/homepage/infra/jpa/post/PostRepositoryImpl.java @@ -179,10 +179,15 @@ public Page findAllByBoardIdAndGroupCodeAndMemberCode(Long boardId, GroupC if (memberCode != null) { whereClause.and(memberEntity.memberCode.eq(memberCode)); } +// if (groupCode != null) { +// whereClause.and(groupEntity.groupCode.eq(groupCode)); +// } + if (groupCode != null) { - whereClause.and(groupEntity.groupCode.eq(groupCode)); + whereClause.and(groupEntity.isNotNull().and(groupEntity.groupCode.eq(groupCode))); } + // if (whereClause.getValue() == null) { // throw new IllegalArgumentException("At least one of memberCode, or groupCode must be provided"); // } @@ -196,6 +201,7 @@ public Page findAllByBoardIdAndGroupCodeAndMemberCode(Long boardId, GroupC .where(whereClause) .orderBy(postEntity.createdAt.desc()); + List content = query .offset(pageable.getOffset()) .limit(pageable.getPageSize())