can you post the database schema for the tables?
valysivec27 wrote:
Hello,
I need to have a one to many relation between the PARENTS - CHILDS tables; and need
the parent the loaded childrens in an indexed collection, so I preserve the order by index.
The problem I have: When I persist the parent, it seems fine, excepting the fact that on the CHILDS
table I see an extra UPDATE that populates the index_col and the PARENT_ID and I don't like that.
I tried to have the mapping attribute inverse = "true" to avoid the problem, the update seems to
go away but the index_col column is left NULL. Any suggestions?
<class name="Parent" table="Parents">
<id name="ID" type="long" column="ID">
<generator class="sequence">
<param name="sequence">sq_id</param>
</generator>
</id>
<property name="field1" column="field1" type="string" length="64"/>
<list name="childrens" table="CHILDS" cascade="all" batch-size="100">
<key column="PARENT_ID" />
<index column="index_col"/>
<one-to-many class="myPackage.Children"/>
</list>
</class>
Thanks,
Valy Sivec