작성
·
231
0
Member findMember = jpaQueryFactory
.selectFrom(QMember.member)
.join(member.team, team).fetchJoin()//뒤에 fetchJoin만 붙여주면 된다.
.where(QMember.member.username.eq("member1"))
.fetchOne();
jpaQueryFactory
.select(QMember.member, team)
.from(member)
.join(member.team, team)
.where(QMember.member.username.eq("member1"))
.fetchOne();
첫번째건 fetchjoin을 사용한 것이고
두번째건 select(member, team) 하고 join 한 것인데
jqpl은 다르게 나가더라도 결국 sql 은 같게 나옵니다.
차이가 없는건가요?
답변 2
1
0