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.  [ 2 posts ] 
Author Message
 Post subject: @OrderBy annotation and Criteria API
PostPosted: Thu Apr 07, 2011 4:50 am 
Newbie

Joined: Thu Apr 07, 2011 4:44 am
Posts: 1
Hello,

I'm using Hibernate 3.3 and everything works more or less :)
But I found that Hibernate is adding an "order by" when using the criteria API because one of the entity used in the criteria has an @OrderBy annotation. This is a problem because I'm using "avg" function and "group by", so my the generated sql doesn't work because I get a "ORA-00979: not a GROUP BY expression"...
Is there a way to remove the automatically added "orderby" ? I would like to avoid removing the annotation.

Hope I'm clear :)

Thanks


Top
 Profile  
 
 Post subject: Re: @OrderBy annotation and Criteria API
PostPosted: Thu Apr 07, 2011 10:21 am 
Regular
Regular

Joined: Fri Jan 28, 2011 11:44 am
Posts: 117
As far as I'm concerned the only way is to remove the annotation ...
Or you could write your own HQL query from scratch ...
But it would be a complete mess if you could enable/disable the annotations as you like!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.