-->
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.  [ 7 posts ] 
Author Message
 Post subject: count in group by or order by (new parser in h3 beta1)
PostPosted: Mon Dec 27, 2004 11:34 am 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
Hibernate 3 beta1 (new parser) don't recognize count in group by or order by clause

count work in select clause

This hql don't work with new parser (it work with old parser)

select bid.item.id,min(bid.created),count(*)
from Bid bid
group by bid.item.id
having min(bid.item.id) > 1
order by bid.item.id,count(*)

or

select bid.item.id,min(bid.created),count(*)
from Bid bid
group by bid.item.id
having count(bid.item.id) > 1
order by bid.item.id

error is in compile query :

ERROR parser: *** ERROR: <AST>:0:0: unexpected AST node: count

regards
Peco


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 27, 2004 12:05 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
CAn you post those bugs into JIRA, please.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 27, 2004 12:19 pm 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
I do and error is in having and order by, not group by - query is correct

regards


Top
 Profile  
 
 Post subject: Re: count in group by or order by (new parser in h3 beta1)
PostPosted: Mon Dec 27, 2004 12:58 pm 
Contributor
Contributor

Joined: Thu Nov 06, 2003 9:49 pm
Posts: 104
Location: New York, NY
snpesnpe wrote:
select bid.item.id,min(bid.created),count(*)
from Bid bid
group by bid.item.id
having min(bid.item.id) > 1
order by bid.item.id,count(*)


Thanks for finding that. Post it to JIRA and I'll fix it.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 27, 2004 2:08 pm 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
I make HHH-75 - I try it with last hibernate cvs too and it don't work

regards


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 27, 2004 2:11 pm 
Contributor
Contributor

Joined: Thu Nov 06, 2003 9:49 pm
Posts: 104
Location: New York, NY
Good. Saw the new defect... like I said, I'm still working on many-to-many.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 28, 2004 9:45 am 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
Joshua,
I try make patch for this.Patch is on http://opensource.atlassian.com/project ... wse/HHH-75

regards
peco


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