Entities or DTOs – When should you use which projection?
JPA and Hibernate allow you to use DTOs and entities as projections in your JPQL and Criteria queries. When I talk about Hibernate performance in my online training or at a workshop, I get often asked, if it matters which projection you use. The answer is: YES! Choosing the right projection for your use case…