That’s the same question I having been confused for a long time.
Is there any way for me to use lazy-loading for one-to-one association using foreign key?
Think I have the following one-to-one relationship:
Code:
<one-to-one name="house" constrained="true" fetch="select" property-ref="owner" cascade="all" lazy="proxy"/>
<many-to-one name="owner" class="Person" column="owner_id" unique="true" cascade="all"/>
Constrained=”true” is useless.
Is that because a proxy will be created only when an Id is found? Why this Id is needed?
Does that mean there is no way for foreign-key one:one lazy loading?
Thank you