-->
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: How to achieve outer join operator(+) in HQL?
PostPosted: Thu Jun 25, 2009 9:20 am 
Newbie

Joined: Tue Jun 03, 2008 3:53 am
Posts: 3
Dear all,
The two tables employee and customer have not explicate association (by FK and PK). In Oracle SQL, we can use the operator (+) as follows for an outer join. For example,

SELECT *
FROM employee, customer
where employee.name = customer.name(+)


However, HQL does not support this outer join operator. How can we translate the above SQL select to HQL?
Regards.
Pengyou [quote][/quote]


Top
 Profile  
 
 Post subject: Re: How to achieve outer join operator(+) in HQL?
PostPosted: Thu Jun 25, 2009 9:30 am 
Newbie

Joined: Tue Jun 23, 2009 3:31 am
Posts: 10
You can try this

from employee e right outer join e.customer


Top
 Profile  
 
 Post subject: Re: How to achieve outer join operator(+) in HQL?
PostPosted: Thu Jun 25, 2009 9:45 am 
Newbie

Joined: Tue Jun 03, 2008 3:53 am
Posts: 3
senthil_rect wrote:
You can try this

from employee e right outer join e.customer


This solution can not work in my case for the following reason:

The table employee has not explicte association with customer (I meant there is no employee.customerId = customer.id defined) so right outer join will gives the exception : org.hibernate.hql.ast.QuerySyntaxException: Path expected for join!


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.