-->
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: generate outer join automatically
PostPosted: Tue Nov 11, 2008 5:07 pm 
Newbie

Joined: Thu Sep 22, 2005 5:17 pm
Posts: 11
Hello,
I have two entities. The first refers the second and the association is mapped with many-to-one in hbm.xml file. This association is nullable (not-null="false").

If I use
Code:
from First
it works fine. All records from First are displayed.

If I run query like
Code:
from First f order by f.second.property
I get result without records with f.second = null

This behavior is right because HIbernate generates inner join in the sql query. But I need outer join to be generated.
I know there is possibility to write the outer join explicitly to hql query like
Code:
from First f left outer join f.second order by f.second.property
but it's not good solution for me because many selects have to be rewritten.

Is here any possibility to tell Hibernate to generate outer join for any query where the Second class is used and the assotiation is nullable?

I use version 3.2.5.GA

Thanks for advices
blaf

_________________
thanks
blaf


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.