Add support for QueryDSL projections in JPA repositories [DATAJPA-1796] #2090
Labels
in: querydsl
Querydsl integration
status: duplicate
A duplicate of another issue
type: enhancement
A general enhancement
marcusvoltolim opened DATAJPA-1796 and commented
QueryDSL projections
QueryDSL projections are simple DTO classes that represent a group of properties to fetch from a database. Projections may be useful when we need only a small subset of columns from the queried entities. In such cases, they help us reduce the traffic between the database and our application.
Spring Data JPA + QueryDSL
Spring Data JPA provides support for the QueryDSL library via the
QuerydslPredicateExecutor
interface.The only required step is to create a repository that extends the executor interface.
From the interface definition, we can clearly see that projections are not supported - there is only one type parameter for the main entity class. Yet, we can quite easily extend the executor interface and provide support for projections and more sophisticated QueryDSL queries.
Article: https://www.talkischeap.dev/querydsl-projections-spring-data
Affects: 2.3.4 (Neumann SR4)
The text was updated successfully, but these errors were encountered: