I have a parent-child relationship using list. for what ever reason, I am not to save a new child directly. I have to add it to its parent, and save the parent instead. But now I have a case where the parent is null, and this trick doesn't work for that. So, I still need to fix it so that I can save by the child.
My hbm is as follows:
Parent:
<class name="Page" >
<id name="pageId" type="int" column="PAGEID" >
<generator class="native" />
</id>
<property name="agename" column="pagename" />
<list name="tables" cascade="all-delete-orphan" >
<key column="PAGEID" not-null="true"/>
<list-index column="tableIdx"/>
<one-to-many class="Table"/>
</list>
</class>
child:
<class name="Table" >
<id name="ableId" type="int" column="TABLEID" >
<generator class="native" />
</id>
<property name="tablename" column="TABLENAME"/>
<many-to-one name="page"
class="Page"
column="PAGEID"
not-null="false"
insert="false"
update="false"/>
</class>
when saving by child, I get
not-null property references a null or transient value: Table._tablesBackref
Is it obvious, what causes the error?
|