-->
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.  [ 6 posts ] 
Author Message
 Post subject: RIGHT OUTER JOIN problem
PostPosted: Fri Apr 02, 2004 7:51 am 
Beginner
Beginner

Joined: Thu Feb 05, 2004 4:59 am
Posts: 23
How to write HQL query, which joins two classes, which are not joined in .hbm.xml configuration files ?
I need a query, like this :
query_str = "SELECT t1.id, t2.name
FROM Table1 t1 RIGHT OUTER JOIN Table2 t2
ON t1.id = t2.id "
The above script throws exception :(
Any ideas ? Maybe to use JDBC - is the only choice in this situation ?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 02, 2004 9:52 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Theta style join in the where clause on a cartesian product:

from A a, B b where a.id = b.id;

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 06, 2004 5:58 am 
Beginner
Beginner

Joined: Thu Feb 05, 2004 4:59 am
Posts: 23
christian wrote:
Theta style join in the where clause on a cartesian product:
from A a, B b where a.id = b.id;


But it won't be a RIGHT OUTER JOIN !


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 06, 2004 6:01 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Thats correct. Map the classes or use native createSqlQuery() if you can't rewrite that query (should be trivial).

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject: Re: RIGHT OUTER JOIN problem
PostPosted: Thu Aug 27, 2009 2:51 am 
Beginner
Beginner

Joined: Wed Aug 22, 2007 5:53 am
Posts: 38
Does theta join supports outer joins in latest version of hibernate?


Top
 Profile  
 
 Post subject: Re: RIGHT OUTER JOIN problem
PostPosted: Thu Aug 27, 2009 8:23 am 
Beginner
Beginner

Joined: Fri Nov 11, 2005 4:35 pm
Posts: 23
Hi,

I switched from hibernate to OpenJPA for that reason.
OpenJPA is better for complex mappings.

Good luck,
Pieter


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 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.