-->
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.  [ 1 post ] 
Author Message
 Post subject: Subselects not usable in HQL case when or arithmetic
PostPosted: Thu Feb 22, 2007 10:49 am 
Newbie

Joined: Thu Feb 22, 2007 9:49 am
Posts: 9
I recently discovered that subselect queries cannot be used within case statements according to the HQL grammar, however, this is definitely supported by MySQL, and a cursory search seems to confirm that it is supported in most DB's.

I found a post relating to a similar issue, only with arithmetic combinations of subselect results, which I had also tried to use to work around this issue, and discovered that the author of the post had tracked the problem to the grammar definition in "hql-sql.g" (unfortunately I have been unable to find the original post again).

I modified the grammar file, and changed the case/when and arithmetic parameter types from "expr" to "exprOrSubquery", and recompiled hibernate and can now use subselects within both case statements and arithmetic without issue.

Is this likely to be changed within the source, or is there a compelling reason that I'm unaware of for this choice?

Thanks,

James


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

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.