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: HQL issue - Please help
PostPosted: Wed Feb 13, 2008 9:05 am 
Newbie

Joined: Tue May 22, 2007 10:02 am
Posts: 7
I need to have the below query in hql but i can not do it
Can anyone help please
thanks

select top(10)
c.*,
es = (select count(*) from EN e where e.contestid = c.id and e.status = 'app')
from con c
where status = 'oe'
and cast = 'P'
and choice = 'Sp'
order by
(select count(*) from EN e where e.conid = c.id and e.status = 'app') desc


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 13, 2008 1:30 pm 
Newbie

Joined: Wed Jan 30, 2008 4:43 pm
Posts: 9
Location: Bend, OR
I know that you can't do session.CreateQuery("select top(10) ...").List() Instead do session.CreateQuery("select ...").SetMaxResults(10).List()

I'm not sure about the rest of it, but that is the one thing that stands out to me.


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.