Limitations on GROUP?
I tried to excecute a HQL like
Code:
select a, count(b) from ClassA a ....
group by a
the generated SQL doesn't include all mapped properties of ClassA,
select a.objID, a.property1, a.property2, count(b.objID) as num
from TABLE_CLASS A ......
group by
a.objID
Actually, the right statement should be like:
select a.objID, a.property1, a.property2, count(b.objID) as num
from TABLE_CLASS A ......
group by
a.objID, a.property1, a.property2
Does it mean I have to explicitly put all properties of a class in the HQL statement when using the 'group by' clause?
Thanks in advance
James