Skip to content

Files

Latest commit

8c2f454 · Nov 27, 2019

History

History

HibernateSpringBootDtoBlazeEntityView

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Jun 10, 2019
Nov 27, 2019
Jun 10, 2019

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 and EntityViewManager
  • 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

If you need a deep dive into the performance recipes exposed in this repository then I am sure that you will love my book "Spring Boot Persistence Best Practices"If you need a hand of tips and illustrations of 100+ Java persistence performance issues then "Java Persistence Performance Illustrated Guide" is for you.