Is it possible to make a one to one relashionship load lazily?
In the below scenario by default I would like not to load the sdos field in obligation.
Code:
<hibernate-mapping>
<class
name="com.vo.cdo.Sdos"
table="SDOS"
proxy="com.vo.cdo.Sdos"
dynamic-update="false"
dynamic-insert="false"
mutable="true"
>
<id
name="referenceObligationId"
column="referenceObligationId"
type="java.lang.Long"
>
<generator class="foreign">
<param name="property">referenceObligation</param>
</generator>
</id>
<property
name="text"
type="java.lang.String"
update="true"
insert="true"
access="property"
column="sdosText"
/>
<one-to-one
name="referenceObligation"
class="com.vo.cdo.ReferenceObligation"
cascade="save-update"
outer-join="auto"
constrained="false"
/>
</class>
</hibernate-mapping>
Code:
<hibernate-mapping>
<class
name="com.vo.cdo.ReferenceObligation"
table="REFERENCE_OBLIGATION"
dynamic-update="false"
dynamic-insert="false"
>
<id
name="id"
column="id"
type="java.lang.Long"
>
<generator class="native">
</generator>
</id>
<property
name="name"
type="java.lang.String"
update="true"
insert="true"
access="property"
column="name"
/>
<one-to-one
name="sdos"
class="com.vo.cdo.Sdos"
cascade="all"
outer-join="auto"
constrained="false"
/>
</class>
</hibernate-mapping>
Many thanks
Simone