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
andBook
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