Hi All,
I have the following mapping in hibernate. When I do a Session.load for Subscriber object. It always return the following
SELECT subscriber0_.SubGuid as SubGuid30_2_, subscriber0_.FirstName as FirstName30_2_, subscriber0_.Version as Version30_2_, account1_.SubscriberId as Subscrib1_31_0_, account1_.Amount as Amount31_0_, address2_.SubGuid as SubGuid32_1_, address2_.FirstLine as FirstLine32_1_, address2_.Version as Version32_1_ FROM dbo.Subscriptions subscriber0_
left outer join dbo.Accounts account1_ on subscriber0_.SubGuid=account1_.SubscriberId
left outer join dbo.Addresses address2_ on subscriber0_.SubGuid=address2_.SubGuid WHERE subscriber0_.SubGuid='2c2c9c82-526e-4a7c-baec-5a1744f32a43'
The relationship between Subscriber and account is one to one and also Subscriber and address is one to one
How do I get hibernate to return to return a inner join instead of a outer join ?
Code:
<class name="A.B.Subscriber, Code" lazy="false" table="Subscriptions">
<id name="SubscriberId" column="SubGuid">
<generator class="assigned" />
</id>
<property name="FirstName" />
<property name="Version" />
<one-to-one name="Account" cascade="all" />
<one-to-one name="Address" cascade="all" />
</class>
<class name="A.B.Account, Code" lazy="false" table="Accounts">
<id name="SubscriberId" column="SubscriberId">
<generator class="foreign">
<param name="property">SubscriberInternal</param>
</generator>
</id>
<property name="Amount" />
<one-to-one name="SubscriberInternal" constrained="true" />
</class>
<class name="A.B.Address, Code" lazy="false" table="Addresses">
<id name="SubscriberId" column="SubGuid">
<generator class="assigned" />
</id>
<property name="FirstLine" />
<property name="Version" />
</class>