Skip to content

Latest commit

 

History

History

HibernateSpringBootDtoViaLeftExcludingJoins

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

How To Use Spring Projections(DTO) And Exclusive Left Joins

Description: This application is a proof of concept for using Spring Projections(DTO) and exclusive left joins written via JPQL and native SQL (for MySQL).

Key points:

  • define two entities (e.g., Author and Book in a (lazy) bidirectional @OneToMany association)
  • populate the database with some test data (e.g., check the file resources/data-mysql.sql)
  • write interfaces (projections) that contains getters for the columns that should be fetched from the database (e.g., check AuthorNameBookTitle.java)
  • write exclusive left joins queries using JPQL/SQL

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.