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: SQL to HQL
PostPosted: Fri Jun 08, 2007 7:21 pm 
Newbie

Joined: Fri Jun 08, 2007 7:05 pm
Posts: 1
Hi people,

I've started using Hibernate 3 days ago :)

what I want is to get HQL of this MySQL code:

select result.id as candidates from (select count(0) mycount, GraduateQualification.Grad_id as id from GraduateQualification where GraduateQualification.Qual_id in (1,2) group by GraduateQualification.Grad_id) as result where result.mycount = 2



GraduateQualification is a mapping class from Hibernate

help me, plz

Regards,
Bassam


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jun 09, 2007 8:20 pm 
Regular
Regular

Joined: Wed Apr 12, 2006 12:49 am
Posts: 105
Location: Malaysia
Hi,

If you refer to section 14.13 page 153 of HIbernate 3.2.2 documentation, there's a note mentioned "Note that HQL subqueries may occur only in the select or where clauses."

So, I guess using HQL subquery in from clause may not be possible.

Hope some senior Hibernate core users / developer can comment on this.

_________________
Thank you.

Regards,
Jap.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 10, 2007 7:35 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Indeed virtual tables are not currently supported by HQL. This may change in the future.


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.