-->
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: Hibernate criteria with subquery in join
PostPosted: Sun Mar 24, 2013 12:41 pm 
Newbie

Joined: Sun Mar 24, 2013 12:56 am
Posts: 3
Is there any way to use the Criteria API sub query in join clause. I have SQL Like this

Code:
select ud.email as email,ul.last_login as last_login,
ul.login_count as login_count, fb_count, m_count from user_details ud
left outer join user_logins userlogins1_ on ud.user_id=ul.user_id
left outer join
(select count(feedback_id) as fb_count,user_id from user_feedback group by user_id) as uf
on ud.user_id=uf.user_id
left outer join (select count(mapid) as m_count,user_id from maps group by user_id) as m
on ud.user_id=m.user_id order by ud.email asc


I saw some where that Criteria do not support Subquery in join but support only in select or where clause. Is this True?

I am not finding a way form the above to rewrite some other way. Please help/suggest me how to proceed


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.