-->
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: Problem writing HQL Query
PostPosted: Tue May 25, 2010 12:02 am 
Newbie

Joined: Mon Mar 15, 2010 1:01 am
Posts: 4
HI,
i am trying to write an hql query with nested select statements, e.g,
Select new Cat(id, name, color,........)
from (
select cat.id as id, cat.color as color, cat.name as name, sum(case when sibs.color = 'Black' and sibs.Type = 'Male' then 1 else 0 end ) as BlackSibs , sum(case when sibs.color = 'White' and sibs.Type = 'Male' then 1 else 0 end ) as WhiteSibs
from Cat cat
join cat.siblings sibs
)
where WhiteSibs >0 and BlackSibs >0

But i am unable to write in a way that works.
Does HQL support nested select statements.
Plz Help.


Top
 Profile  
 
 Post subject: Re: Problem writing HQL Query
PostPosted: Tue May 25, 2010 12:41 am 
Newbie

Joined: Mon Mar 15, 2010 1:01 am
Posts: 4
Hi,
anybody around...
please help me out in this...


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.