I have a one to one relationship from one object to another(Member to JobPost). Both objects have the lazy attribute so they can be proxied.
When I query for the Member object an additional sql query is issued immediatly to load the JobPost which is specified as the one-to-one. Are my settings wrong? Is this a bug? I have abbreviated the mappings and listed them below.
Code:
<class name="Member" table="Member" lazy="true">
<!--ID-->
<id name="Id" column="MemberId" unsaved-value="0" access="nosetter.camelcase-underscore">
<generator class="identity" />
</id>
<!--ASSOSCIATIONS-->
<one-to-one name="JobPost" class="JobPost" property-ref="StaffMember" access="nosetter.camelcase-underscore" outer-join="true" />
</class>
<class name="JobPost" table="JobPost" lazy="true">
<!--ID-->
<id name="Id" column="JobPostId" unsaved-value="0" access="nosetter.camelcase-underscore">
<generator class="identity" />
<!--ASSOSCIATIONS-->
<many-to-one name="StaffMember" column="MemberId" class="Member" access="nosetter.camelcase-underscore" outer-join="true" unique="true" />
</class>