-->
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: Order HQL result by # of matched correlated subqueries?
PostPosted: Wed Feb 04, 2009 11:00 am 
Newbie

Joined: Thu May 01, 2008 11:52 am
Posts: 17
Code:
from Cat as cat
where exists (
    (from Dog as dog1 where dog1.friend = cat)
    OR
    (from Dog as dog2 where dog2.buddy = cat)
)



I would like my Cat results to be ordered by the number of matches for either of these subqueries.

(In this example, Cats would be ordered by number of canine friends or buddies).

Can this be done?


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.