-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Limitations on GROUP?
PostPosted: Sun Jul 11, 2004 5:47 am 
Beginner
Beginner

Joined: Mon May 17, 2004 7:15 am
Posts: 24
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


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 11, 2004 8:11 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
http://www.hibernate.org/74.html#A12

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 11, 2004 8:41 am 
Beginner
Beginner

Joined: Mon May 17, 2004 7:15 am
Posts: 24
christian wrote:
http://www.hibernate.org/74.html#A12


Thanks a lot.

James


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.