Skip to content

Files

Latest commit

433cc5d · Nov 27, 2019

History

History

HibernateSpringBootDtoViaFullJoinsMySQL

How To Use Spring Projections(DTOs) And Inclusive Full Joins (MySQL)

Description: This application is a proof of concept for using Spring Projections(DTO) and inclusive full joins written in native SQL (for MySQL).

Key points:

  • define two entities (e.g., Author and Book in a lazy bidirectional @OneToMany relationship)
  • 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 inclusive full joins queries using native 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.