inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

ykmykm4608님의 게시글

ykmykm4608 ykmykm4608

@ykmykm46089813

수강평 작성수
-
평균평점
-

게시글 3

질문&답변

JPQL 동적쿼리 부분 - > QUERYDSL 마이그레이션 후 질문

혹시 fetchjoin 적용 안된거 같은데 할필요가 없는걸까요? public List findTransactionList(Long accountId, String gubun, Integer page){ JPAQuery query = jpaQueryFactory.selectFrom(transaction); return query .leftJoin(transaction.withdrawAccount).leftJoin(transaction.depositAccount) .where(gubunCheck(gubun, accountId)) .limit(3).offset(page*3) .fetch(); } private BooleanExpression gubunCheck(String gubun, Long accountId){ if (!StringUtils.hasText(gubun)){ return transaction.withdrawAccount.id.eq(accountId).or(transaction.depositAccount.id.eq(accountId)); }else if(TransactionEnum.valueOf(gubun) == TransactionEnum.DEPOSIT){ return fetchjtransaction.depositAccount.id.eq((accountId)); }else if(TransactionEnum.valueOf(gubun) == TransactionEnum.WITHDRAW){ return transaction.withdrawAccount.id.eq(accountId); }else { return null; } }

좋아요수
0
댓글수
2
조회수
534