An example of combining the two most powerful frameworks for building a maintainable and type-safe persistence layer; from Spring Data JPA we will take only CRUD operations and for all complex queries we will use QueryDSL.

You can find the full project on GitHub using this link. There is a simple SpringBoot application with configured MySQL data source and initial database structure described as a Flyway migration.

Here we will concentrate only on the building persistence layer. As we deal with the relational database we will rely on the JPA specification. Let’s take a simple entity model like Author/Book as an example:

#java #tutorial #spring boot #hibernate #jpa #spring data jpa #querydsl

Spring Data JPA + QueryDSL: Taking the Best From Both Worlds
4.15 GEEK