我有一个 Slab 对象的映射,它具有对对象和 SlabPDO SlabInstructions 的映射引用。我想做选择,总是携带对象 SlabPDO 并仅在必要时加载 SlabInstructions。有没有办法做到这一点?下面是一个映射示例:
<id name="Id" column="Id_Slab" type="Int64">
<generator class="Geraes.GLib.GDomainBasis.CustomTableHiLoGenerator, GLib.GDomainBasis" />
</id>
<property name="Mill" column="Mill" type="String" length="2" not-null="true" />
<property name="SlabId" column="Slab_Id" type="String" length="20" not-null="true" />
<property name="PieceId" column="Piece_Id" type="String" length="20" not-null="true" />
<one-to-one name="SlabPDO" class="SlabPDO" cascade="all" fetch="join"/>
<set name="SlabInstructions" generic="true" inverse="true" lazy="false" cascade="all" fetch="join">
<key column="Id_Slab" />
<one-to-many class="SlabInstruction"/>
</set>
最好的祝福!