인프런 영문 브랜드 로고
인프런 영문 브랜드 로고

Inflearn Community Q&A

woojin1260767's profile image
woojin1260767

asked

Real-world! Spring Boot and JPA Utilization 2 - API Development and Performance Optimization

Order Lookup V5: Direct DTO Lookup in JPA - Optimized Collection Lookup

V5 에서 질문이있습니다.

Written on

·

431

3

여기서 oi.order.id in 을사용하셨는데욤

이곳은 배치사이즈가 안먹히나요?~~

배치사이즈설정도 in 쿼리로 나가는걸로 이해를해서요~

  List<OrderItemQueryDto> orderItems = em.createQuery(
                "select new jpabook.jpashop.repository.order.query.OrderItemQueryDto " +
                        " ( oi.order.id, i.name, oi.orderPrice, oi.count  )" +
                        "from OrderItem oi " +
                        " join oi.item i " +
                        " where oi.order.id in :orderIds ", OrderItemQueryDto.class)
                .setParameter("orderIds", orderIds)
                .getResultList();
JPAspring-bootjavaspring

Answer 2

4

yh님의 프로필 이미지
yh
Instructor

안녕하세요. woojin126님

배치사이즈는 엔티티를 조회할 때 가능합니다. 지금은 엔티티가 아니라 DTO로 조회했기 때문에 배치사이즈 같은 옵션을 사용할 수 없습니다.

감사합니다.

0

woojin1260767님의 프로필 이미지
woojin1260767
Questioner

감사합니다

woojin1260767's profile image
woojin1260767

asked

Ask a question