Hibernate version: 2.1.8
Name and version of the database you are using: Oracle 9i
Hello. i've got a major hibernate mappings problem...
I have a one to many relationship between 2 classes: IndexRecord and IndexValue.
The mapping in IndexRecord looks like this:
<list name="values" cascade="all-delete-orphan" lazy="true">
<key column="INDEX_RECORD_ID"/>
<index column="POSITION" type="string" />
<one-to-many class="pl.empolis.rzepicha.portal.domain.index.helpers.IndexValue"/>
</list>
And for IndexValue:
<many-to-one name="indexRecord" column="INDEX_RECORD_ID" class="pl.empolis.rzepicha.portal.domain.index.helpers.IndexRecord"/>
And the thing is that when I add a new value to record
it adds to database with index = 1, not 0 and it produces a big mess afterwards because hibernate seems to get lost upon this kind of situation
any ideas what I may be doing wrong?
Maybe another hint: IndexValue is also connected with IndexField (one IndexField, many IndexValues), but there is no <list> attribute for IndexValue in IndexField mapping, cuz I don't need one (at least I thought I didn't), just <many> attribute in IndexValue, like the one for IndexRecord.
Any ideas welcome...
_________________ michuk
|