-->
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-many not setting foreign keys
PostPosted: Wed Mar 15, 2006 7:12 am 
Newbie

Joined: Tue Mar 07, 2006 3:15 pm
Posts: 17
Hi

I have the following mappings:


Code:
Offer.hbm.xml:

<array name="ansatte" table="OFFERT_PERSON_BA" cascade="all">
   <key column="OFFERT_ID" not-null="true" />
   <index column="OFFERT_INDEX"/>
   <many-to-many column="PERSON_ID" class="AnsattDO"/>
</array>

Person.hbm.xml

<array name="offerter" table="OFFERT_PERSON_BA" cascade="all">
   <key column="PERSON_ID" not-null="true"/>
   <index column="PERSON_INDEX"/>
   <many-to-many column="OFFERT_ID" class="OffertDO" />
</array>


I have tried with and without not-null="true" for the keys.

When I use saveOrUpdate Hibernate inserts at both ends of the many-to-many but the join-table (OFFERT_PERSON_BA) is not updated with the relationship info. Any ideas?


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.