Hi all,
I am looking for a solution to perform a particular HQL Query.
I would like to execute a Group by, on a collection size.
I got a class :
Code:
MyClass{
...
Set<MyClass2> myCol ...
..
}
the query is like this :
Code:
select count(it.id), cCol is not null from MyClass it left join it.myCol as cCol group by (cCol is not null)
or
Code:
select count(it.id), cCol is empty from MyClass it left join it.myCol as cCol group by (cCol is empty)
I've discovered that I can't use "is not null" in the select clause, and that's the same for "is empty"
I got a "unexpected AST Node" exception with the both previous queries.
Is there a way to do this: get two groups of "MyClass", and differentiate on the facts the collection "myCol" is empty or not ?
Thanks in advance for your help.
Regards,
Farf