-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Many to one mapping - skipping position 0
PostPosted: Sun Oct 16, 2005 7:14 am 
Newbie

Joined: Sun Oct 16, 2005 6:58 am
Posts: 1
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.