작성
·
252
0
안녕하세요 선생님.
강의에서 궁금한 점이 생겨서 질문드립니다.
List<OrderDto> orders = orderRepository.findALlWithMemberDelivery(offset, limit)
.stream().map(o -> new OrderDto(o)).collect(toList());
멤버와 딜리버리가 페치조인된 첫번째 쿼리가 나가고
지연로딩으로 OrderItem을 조회하는 쿼리에서
select
orderitems0_.order_id as order_id5_5_0_,
orderitems0_.order_item_id as order_it1_5_0_,
orderitems0_.order_item_id as order_it1_5_1_,
orderitems0_.count as count2_5_1_,
orderitems0_.item_id as item_id4_5_1_,
orderitems0_.order_id as order_id5_5_1_,
orderitems0_.order_price as order_pr3_5_1_
from
order_item orderitems0_
where
orderitems0_.order_id=?
order_id와 order_item_id가 select문에 두번씩 조회되는데 왜 그런지 생각해봐도 이유를 모르겠네요ㅜㅜ
감사합니다!!
답변 2
1
1