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.  [ 2 posts ] 
Author Message
 Post subject: many-to-many association is doubling database entries
PostPosted: Tue Dec 18, 2007 10:19 am 
Newbie

Joined: Tue Dec 18, 2007 10:10 am
Posts: 2
Hi,

i'm using Hibernate version:1.2.0 and realized a many-to-many association like shown in 6.8. It does almost what i want it, but in the table of the inverse end it generates double entries (only primary and foreign key) and so also key violations.

To be honest i don't know how hibernate may store this at all, but maybe you can help me.


the relevant mappings are

<bag name="Fahrzeugkomponenten" table="Komponente" lazy="true">
<key column="FahrzeugzuordnungIst"/>
<many-to-many class="Komponente" column="KomponentenId"/>
</bag>

and

<bag name="FahrzeugzuordnungIst" table="Komponente" inverse="true" lazy="true">
<key column="KomponentenId"/>
<many-to-many class="Fahrzeug" column="FahrzeugId"/>
</bag>


Thank you.

Greets Hellmut


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 12, 2008 11:24 am 
Newbie

Joined: Tue Dec 18, 2007 10:10 am
Posts: 2
anybody a hint??

(btw: 6.8 referes to http://www.hibernate.org/hib_docs/nhibe ... tions.html )


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

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.