-->
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: Force inner join for <join>-mapping
PostPosted: Tue Sep 07, 2010 5:50 am 
Newbie

Joined: Tue Sep 07, 2010 5:37 am
Posts: 1
Hi all,

I have two entities E_A and E_B and three tables T_A, T_B1 and T_B2. (legacy table model, that's why there are more tables)

- E_A maps to T_A.
- E_B maps to T_B1 and T_B2 where T_B2 is linked in with a <join> mapping.
- There is a collection of E_Bs in E_A.

If I load all E_Bs, all entries of T_B1 are fetched, plus an inner join is made on T_B2.
If I load all E_As using fetch mode "join" on the collection of E_Bs, all entries of T_A are fetched, plus an outer join is made on T_B1, plus an outer join is made on T_B2.

I need the join on T_B2 to be an inner join however, just like when loading E_Bs. I took the hibernate SQL statement, replaced the outer join with an inner join, executed in on the DB and got exactly the desired result. I cannot force Hibernate to do this, however.

Is there some logical necessity to make an outer join, or did I miss a way to configure hibernate?

Thanks for your help!
Gerhard


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.