Hibernate version: 1.2.0
I have a class, EfpSecurityNHib, that has a member reference, DerivDetail. When I load EfpSecurityNHib with fetch="join", I do get a select with outer join, but then NHibernate does another select on the DerivDetail class!
Here's the map file contents:
===============================================================
Code:
<?xml version="1.0" encoding="utf-8"?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="EfpSecurityNHib, DASDataSourceSecurityPrd" table="hts_sec_master" lazy="false">
<id name="sm_id" column="sm_id">
<generator class="Efp.Das.DataSource.Orm.NHibernate.GetNextRowIdGenerator, DASDataSource">
<param name="table">hts_sec_master</param>
</generator>
</id>
<property name="sm_sec_type" insert="false" update="false"/>
<many-to-one name="DerivDetail" column="sm_id" property-ref="deriv_sm_id"
unique="true" insert="false" update="false" cascade="all"
lazy="false" fetch="join"/>
</class>
</hibernate-mapping>
===============================================================
Notes:
- DerivDetail is a property of EfpSecurityNHib
- sm_id is the id column of hts_sec_master, which is mapped to EfpSecurityNHib
- deriv_sm_id is a simple property the class of DerivDetail
- The class of DerivDetail is mapped to table hts_sm_deriv_detail.
The following code results in a left outer join select *and* a separate select of hts_sm_deriv_detail.
===============================================================
Code:
EfpSecurityNHib sec = (EfpSecurityNHib)session.Load(typeof(EfpSecurityNHib), 3979190);
===============================================================
Why am I getting the extra select?!?
Thanks in advance for any help!
Code:
Code:
Code:
Code: