How To Fetch DTO Via Blaze-Persistence Entity Views
Description: Fetching more data than needed is prone to performance penalities. Using DTO allows us to extract only the needed data. In this application we rely on Blaze-Persistence entity views.
Key points:
- for Maven, add in
pom.xml
the dependencies specific to Blaze-Persistence - configure Blaze-Persistence via
CriteriaBuilderFactory
andEntityViewManager
- write an entity view via an interface in Blaze-Persistence fashion
- write a Spring-centric repository by extending
EntityViewRepository
- call method of this repository such as,
findAll()
,findOne()
, etc - for using Spring Data Projections check this item