jopa icon indicating copy to clipboard operation
jopa copied to clipboard

Support constructor expressions in SOQL

Open ledsoft opened this issue 2 years ago • 0 comments

As a user, I want to be able to easily create objects (DTOs) from SOQL query results. JPQL allows specifying a constructor that is passed the projected query variables and is used to initialize the result objects. The syntax is:

SELECT NEW example.CountryAndCapital(c.name, c.capital.name) FROM Country c

It would be nice if SOQL supported this feature as well.

ledsoft avatar Sep 22 '23 12:09 ledsoft