jopa
jopa copied to clipboard
Support constructor expressions in SOQL
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.