작성
·
2.2K
0
안녕하세요
querydsl 코딩하다 막히는부분이 있어 질문글 남깁니다.
return applyPagination(pageable, contentQuery -> contentQuery
.selectDistinct(new QLocationDetailDto(
member.idx.as("idx"),
member.nickname.as("nickname"),
member.memberImg.as("img"),
ExpressionUtils.as(
JPAExpressions.selectDistinct(qaComment.qa.idx.count())
.from(qaComment)
.join(qaComment.qa, qa)
.where(qaComment.member.eq(member)), "answerCount"))
)
.from(member)
.leftJoin(member.memberAddress, memberAddress)
.leftJoin(member.qaComments, qaComment)
.where(
memberAddress.cityIdx.eq(cityIdx),
member.grade.ne(QUIT),
member.phoneNum.isNotNull(),
memberEqualsRegion(regionIdx)
)
.orderBy("answerCount").desc() );
orderBy에 서브쿼리 이름명을 넣고싶은데 안되는거같아 문의드립니다
다른방법이 있을까요
감사합니다 도움 됐습니다