-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
in: query-parserEverything related to parsing JPQL or SQLEverything related to parsing JPQL or SQLtheme: projectionsRefinements around DTO and interface projectionsRefinements around DTO and interface projectionstype: enhancementA general enhancementA general enhancement
Milestone
Description
Consider the following query:
@Entity
class Person { … }
class PersonProjection { … }
@Query("SELECT p FROM Person p")
PersonProjection findBy(…)
The query selects items from the Person entity while its return type is a DTO projection.
It would be good to rewrite such queries to use DTO projections for matching properties along the lines of:
@Query("SELECT new com.acme.PersonProjection(p.firstName, p.lastName) FROM Person p")
PersonProjection findBy(…)
Metadata
Metadata
Assignees
Labels
in: query-parserEverything related to parsing JPQL or SQLEverything related to parsing JPQL or SQLtheme: projectionsRefinements around DTO and interface projectionsRefinements around DTO and interface projectionstype: enhancementA general enhancementA general enhancement