-->
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: HQL: right join question
PostPosted: Fri Apr 20, 2007 6:52 am 
Newbie

Joined: Wed May 31, 2006 12:58 pm
Posts: 14
Hibernate version: 2.1

Mapping documents:
...
<subclass
name="mypackage.TLine"
proxy="mypackage.TLine"
discriminator-value="P">
<many-to-one name="myObjectRef" column="MY_OBJECT_ID" class="mypackage.MyObject"/>
</subclass>


Name and version of the database you are using: Oracle 9

So, I have an instance of TLine class, which does refer to an instance of MyObject class. At the same time, MyObject may exist without TLine referring to it. In MyObject's mapping there is nothing about TLine.

There is a group of two MyObjects, one of which has a TLine associated with it and another does not have. The group has its own unique id.

The following HQL query will return me data about two MyObject instances:
Code:
select do.key
from MyObject do
where do.group.key = 51885


The following query returns me data regarding the only MyObject, which has a TLine:
Code:
select do.key
from TLine line               
right join line.myObjectRef do,
where do.group.key = 51885


Why? I use an outer join here...

Thanks in advance!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 20, 2007 6:54 pm 
Beginner
Beginner

Joined: Tue Oct 10, 2006 3:23 am
Posts: 33
outer join would read:
left join...
you have right join


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 23, 2007 3:18 am 
Newbie

Joined: Wed May 31, 2006 12:58 pm
Posts: 14
mooritze wrote:
outer join would read:
left join...
you have right join


But what I need here is a right join, because in mapping file I have a reference "from the left to the right". Is it impossible to say Hibernate to do a "real" right 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.