본문 바로가기

Yebali

검색하기
Yebali
프로필사진 예발이

  • 분류 전체보기 (102)
    • Spring (34)
    • Kotlin (13)
    • Apache (2)
    • Design Pattern (1)
    • DB (6)
    • Kafka (14)
    • Backend Common (21)
    • 설계 (1)
    • AWS (4)
    • Etc (5)
    • 일기장 (0)
Guestbook
Notice
Recent Posts
Recent Comments
Link
«   2026/01   »
일 월 화 수 목 금 토
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Tags
  • centos7
  • Spring JPA
  • ECS
  • Streams
  • topic생성
  • Kubernetes
  • JPA
  • Spring Data JPA
  • spring
  • PAGING
  • mysql
  • transactionaleventlistener
  • offsetdatetime
  • producer
  • spring kafka
  • cd
  • kafka
  • K8s
  • pgvector
  • entity graph
  • AWS
  • API
  • CodePipeline
  • Entity
  • git
  • CI
  • bean
  • QueryDSL
  • consumer
  • Kotlin
more
Archives
Today
Total
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록Collection (1)

Yebali

Spring을 이용한 API 개발 - Collection 조회 최적화

Collection조회란 Entity에서 일대다 관계(@OneToMany)를 조회하는 것이다. fetch join을 사용한 컬렉션 조회 Controller @GetMapping("/api/v3/orders") public List ordersV3() { List orders = orderRepository.findAllWithItem(); List result = orders.stream() .map(o -> new OrderDto(o)) .collect(toList()); return result; } Repository public List findAllWithItem() { return em.createQuery( "select distinct o from Order o" + " join fetch..

Spring 2021. 10. 11. 20:35
이전 Prev 1 Next 다음

Blog is powered by kakao / Designed by Tistory

티스토리툴바