Spring Data JPA Projections

최대 1 분 소요

1. projections

JPA에서 가져온 entity를 보통 그대로 가져다 쓰지는 않는다.
호환성, 확장성 같은 이유가 있기도 하고
FetchType.LAZY나 필요없는 정보까지 다 끌어오기 때문이기도 하다.
https://www.baeldung.com/spring-data-jpa-projections

2. findById with projection in Spring Data

그럼 findById 같이 기본적으로 JpaRepository에서 제공하는 query method를 어떻게 Dto로 받을까?
stackoverflow.com 답변
docs.spring.io 공식문서

댓글남기기