We have a parent object with a lazily loaded child (mapped as many-to-one). When we try to access the child's Id property after the Session in which we retrieve the parent has been closed, a LazyInitializationException is thrown... but this seems to contradict the behaviour described in 14.2 of the nHib 1.0.2 documentation ( we are using v1.2 but I assume this it is still true that you should be able to access the ID of a proxy without a database call being required ).
Our mapping file is as follows:
Code:
<class name="Parent" proxy="IParent" table="parent">
<id name="Id" type="System.Decimal" unsaved-value="0" column="ParentId" >
<generator class="native"/>
</id>
<version name="Version" type="Int32" column="ccn" unsaved-value="-1"/>
<snipped>
<many-to-one name="Child" column="ChildId" class="Child"/>
</class>
Thanks