-->
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: Left joining with a query
PostPosted: Thu Aug 15, 2013 6:54 am 
Newbie

Joined: Thu Aug 15, 2013 6:45 am
Posts: 1
Hi Everyone,

I have this MySQL query that i would like create by using Criteria in Hibernate:

select distinct this_.id as y0, ap.number, ap.account_phone_number_type, p1.number1, p1.type1 from account this_ left outer join account_phone_number ap on this_.id=ap.account_id left join (select this_.id as y1, ap.number as number1, ap.account_phone_number_type as type1 from account this_ left outer join account_phone_number ap on this_.id=ap.account_id where ap.account_phone_number_type="RECEPTION") p1 on this_.id=y1 group by y0 order by p1.number1 desc limit 100;

How is it possible to left join a query in Hibernate?


Top
 Profile  
 
 Post subject: Re: Left joining with a query
PostPosted: Mon Aug 19, 2013 7:23 am 
Beginner
Beginner

Joined: Wed Feb 06, 2013 2:43 am
Posts: 46
checking some thing as a test

_________________
Thanks,
Ajit Singh
ajits@mindfiresolutions.com
www.mindfiresolutions.com


Top
 Profile  
 
 Post subject: Re: Left joining with a query
PostPosted: Mon Aug 19, 2013 7:25 am 
Beginner
Beginner

Joined: Wed Feb 06, 2013 2:43 am
Posts: 46
you can not left join on a query , you can do it on a table.

but you can twist your query to use simple inner join .
example : https://forum.hibernate.org/viewtopic.php?f=1&t=1025421

_________________
Thanks,
Ajit Singh
ajits@mindfiresolutions.com
www.mindfiresolutions.com


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.