Joined: Wed Apr 11, 2007 10:34 am Posts: 3
|
Hi,
I have following exception
NHibernate.MappingException: Repated column in mapping for class MyObject should be mapped with insert="false" update="false": ParentID
and .hbm.xml
<class name="MyObject" table="MyObject" lazy="true">
<many-to-one name="m_Parent" class="MyObject" column="ParentID" cascade="save-update" access="field">
<meta attribute="protected"/>
</many-to-one>
<bag name="m_Children" table="MyObject" lazy="true" access="field" inverse="true" cascade="save-update">
<meta attribute="protected"/>
<key column="ParentID"/>
<one-to-many class="MyObject"/>
</bag>
<property name="ParentID" column="ParentID" type="System.Int32" update="true" insert="false"/>
...
When update="false" it throws no exception but I need to update ParentID so it cann't be update=""false.
How can I fix this exception ?
Thank yuo very much :-)
|
|