Skip to content

Commit

Permalink
[hotfix] groupEntity와 memberEntity 간 조인 조건 명확히 하여 groupCode 관련 경로 표현식…
Browse files Browse the repository at this point in the history
… 오류 해결
  • Loading branch information
chahyunsoo committed Oct 10, 2024
1 parent 57a7a84 commit 573566b
Showing 1 changed file with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,15 +187,24 @@ public Page<Post> findAllByBoardIdAndGroupCodeAndMemberCode(Long boardId, GroupC
// throw new IllegalArgumentException("At least one of memberCode, or groupCode must be provided");
// }

// JPAQuery<PostEntity> query = queryFactory
// .selectFrom(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)
// .orderBy(postEntity.createdAt.desc());

JPAQuery<PostEntity> query = queryFactory
.selectFrom(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)
.leftJoin(groupEntity).on(memberEntity.groupEntity.eq(groupEntity))
.where(groupEntity.groupCode.eq(groupCode)) // 테스트로 간단히 구성
.orderBy(postEntity.createdAt.desc());



List<PostEntity> content = query
.offset(pageable.getOffset())
.limit(pageable.getPageSize())
Expand Down

0 comments on commit 573566b

Please sign in to comment.