persistence icon indicating copy to clipboard operation
persistence copied to clipboard

allow subqueries to select CompoundSelection

Open asafbennatan opened this issue 2 years ago • 3 comments

this is a huge limitation , the only way around is to create an inefficient query.

asafbennatan avatar Dec 24 '22 20:12 asafbennatan

Per-spec, subqueries in JPA today can only occur in the where or having clause. Given that limitation, it's not immediately obvious to me why allowing multiple expressions in the select list would be useful.

So, please at least give us an example of the kind of query you would like to write. (A real-world example illustrating the practical usefulness.)

[FTR, Hibernate supports what you're asking for, but Hibernate allows subqueries in other clauses of the query.]

gavinking avatar Aug 15 '23 18:08 gavinking

Maybe he is referring to subqueries in the from clause? This seems to be supported as of EclipseLink 2.4 and Hibernate 6.1. Maybe it's time for standardization of this feature?

beikov avatar Aug 16 '23 07:08 beikov

Maybe he is referring to subqueries in the from clause?

I mean: sure, maybe? But it's the job of the reporter of an issue to properly describe their issue. It's not our job to speculate what they might have meant from a completely insufficient description of the problem.

Maybe it's time for standardization of this feature?

Well that's why I already opened #401 quite a while ago. So if that's what is being requested we can just close this.

gavinking avatar Aug 16 '23 07:08 gavinking