-->
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: Sequence conflicts when saving many-to-many <list>
PostPosted: Tue Jun 21, 2005 5:13 am 
Newbie

Joined: Tue Jun 21, 2005 4:53 am
Posts: 2
Hi. This one's a bummer.

I have a mapping table (let's call it mappingTable), used to map a many-to-many list of child entities within a parent entity. The parent's .hbm.xml relationship looks like this :

<list name="children" lazy="true" table="mappingTable" cascade="all">
<key column="parentId"/>
<index column="id"/>
<many-to-many column="childId" class="com.Child"/>
</list>

Problem : When a transaction commits (after having called parent.setChildren()), a SQLException is thrown beacause no unique constraint for mappingTable has been defined (i.e. mappingTable's sequence is undefined, and is not being incremented after each child insert)

I have defined this sequence in Oracle, but cannot find where to declare it in my hibernate List mapping.

Any help greatly appreciated!
Donovan


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.