I have a bidirectional parent<->child relationship from DocumentClass (parent) to Document (child) where DocumentClass holds an indexed list of Documents. The db table for Document has an index column "doc_position", and the relevant excerpts from my mappings are
[DocumentClass.hbm.xml]
<list name="documents" lazy="true" inverse="true" cascade="all-delete-orphan">
<key column="documentclass_id"/>
<index column="doc_position"/>
<one-to-many class="manplan.j2ee.model.Document"/>
</list>
[Document.hbm.xml]
<many-to-one
name="documentClass"
class="manplan.j2ee.model.DocumentClass"
cascade="save-update"
outer-join="auto"
update="true"
insert="true"
column="documentclass_id"
not-null="false"
/>
Upon saving a newly created DocumentClass and its associated child Documents via
Code:
session.saveOrUpdate(documentClass);
session.saveOrUpdate(document);
Hibernate ignores the index column "doc_position" and leaves it at <null> whereas all other columns are treated correctly. I have some other associations with list semantics which exhibit the exact same behaviour. I am running Hibernate 2.1.2 against a Firebird database. What am I doing wrong here?
Thanks,
Olaf