-->
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.  [ 4 posts ] 
Author Message
 Post subject: hbm mapping for outer join on composite foregin key
PostPosted: Wed Feb 25, 2009 2:33 pm 
Newbie

Joined: Wed Feb 25, 2009 2:02 pm
Posts: 2
Location: Maine
Hibernate version: Looks like Hibernate 3.x

Mapping documents:

<many-to-one name="CatalogSource" class="com.xxx.yyy.domain.CatalogSource" insert="false" update="false">
<column name="SRC_ID" not-null="false"/>
<column name="MERC_SEAS_YR_ID" not-null="false"/>
</many-to-one>


Name and version of the database you are using: DB2

The generated SQL (show_sql=true):

inner join
zzz.CATALOG_SRC catsrc2_
on this_.SRC_ID=catsrc2_.SRC_ID
and this_.MERC_SEAS_YR_ID=catsrc2_.MERC_SEAS_YR_ID



I need to know how to change the mapping to make this an outer join. I've tried adding fetch="join" and/or outer-join="true". No luck so far.

Any help? Do I need to switch over to HQL?

Thanks,
-Tim


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 25, 2009 7:03 pm 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
Quote:
Any help? Do I need to switch over to HQL?


So what are you using right now to get the partial SQL? In HQL it is easy. Use
'left join' instead of 'join'.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 25, 2009 10:19 pm 
Newbie

Joined: Wed Feb 25, 2009 2:02 pm
Posts: 2
Location: Maine
This is the automatically generated SQL, copied from the log. Currently I am strictly using hibernate mapping files, not HQL.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 26, 2009 3:59 am 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
Quote:
This is the automatically generated SQL, copied from the log.


Somewhere in your code you are doing something that generates the SQL. It would be nice if you could show that part of the code and also the complete SQL that it generates.


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