-->
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.  [ 1 post ] 
Author Message
 Post subject: Outer join sneak
PostPosted: Wed Oct 24, 2012 3:11 pm 
Newbie

Joined: Wed Oct 24, 2012 2:56 pm
Posts: 1
I am trying to select a field that is in one of two classes. The association is not (cannot be) mapped because of restrictions on foreign key reuse. So I'm trying to sneak an outer join, with this HQL

Code:
select ... from  mainclass h, someclass q, otherclass r where ...

and ((q.keyclass.key1 = h.keyclass.key1  and q.keyclass.key2 =  h.keyclass.key2 )
       or (r.keyclass.key1 = h.keyclass.key1 and r.keyclass.key2 = h.keyclass.key2))



The field is never in both files at the same time. The inner join (default) puts an entry in the result set that doesn't match the key restriction. I suppose that is design, not a bug?

_________________
Using Hiberate 4.1.6 vs DB2, various Spring projects (recent or newest), Tomcat 7.0.29, JSF 2.0/Prime 3.4.1


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.