-->
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: nhibernate generate left outer join on nested many-to-one
PostPosted: Wed Jun 23, 2010 7:01 am 
Newbie

Joined: Thu Jan 28, 2010 10:49 am
Posts: 5
hi,

i'm using nHibernate 2.1.2 and relized that nhibernate will generate left outer join on nested many-to-one entities. it seems start generate left-outer-join on 3rd nested note onwards which start from entity Organization. i have set following in the mapping file to force use inner-join, has anything i missed out in the mapping file? really hope somebody could give me a hint on this. appreciate any helps!

Code:
lazy="false" fetch="join"


Example Entites and Relationships:
Quote:
Sales Record n-1 Employee n-1 Organization


nhibernate generate:

Code:
    select...
    from sales
    inner join employee
    left outer join organization


Sales.hbm.xml

Code:
<many-to-one name="Employee" insert="true" update="true" access="field.pascalcase-underscore" not-null="true" lazy="false" fetch="join"/>
    <column name="EmployeeId" not-null="true"/>
    </many-to-one>


Employee.hbm.xml

Code:
<many-to-one name="Organization" insert="true" update="true" access="field.pascalcase-underscore" not-null="true" lazy="false" fetch="join"/>
    <column name="OrgId" not-null="true"/>
    </many-to-one>


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.