-->
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: left outter join on a table with two other unrelated ref
PostPosted: Fri May 29, 2009 1:05 pm 
Newbie

Joined: Mon May 01, 2006 2:11 am
Posts: 4
I would like to left outter join on a table (profile) with two other unrelated reference tables
Could you please help me to write the HQL query
I am using the latest version of hibernate 3.3 , spring 3.0 and java 5

select p.id,p.name, c.value, b.value
from profile p
left outer join ref_business_type b
on p.business_type_code = b.code and b.locale ='en_CA'
left outer ref_city c
on c.city_code = c.code and c.locale ='en_CA'
where p.id > 1


profile table
id, name, business_type_code, city_code

ref_business_type table
id, code, value, locale

ref_city table
id, code, value, locale


Top
 Profile  
 
 Post subject: Re: left outter join on a table with two other unrelated ref
PostPosted: Tue Jun 22, 2010 10:54 am 
Newbie

Joined: Wed Feb 10, 2010 7:19 pm
Posts: 12
Did you get any solution for it. Even i have the same requirement.
Plz let me know.

Thanks


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.