-->
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 relationship : Data Not getting Inserted...
PostPosted: Sat Oct 23, 2004 2:51 am 
Newbie

Joined: Sat Oct 23, 2004 2:37 am
Posts: 2
I am a quite new to hibernate. Here i am trying to implement a many-to-many relationship with following setting in mapping.xml.

When i am retriving data i dont have any problem. But when i am trying to insert data it is not getting inserted ..!

Even I can't see any exception being thrown by hibernate on console.

Can naybody help me reagarding this?

<class name="SetNameType" table="SET_NAME">
<id name="id" column="SET_NAME_ID" type="long">
<generator class="assigned"/>
</id>
<property name="setName" column="SET_NAME" type="string"/>
<set name="clinicItems" table="SET_ITEM" inverse="true">
<key column="set_name_id"/>
<many-to-many class="ClinicItemType"
column="CLINIC_ITEM_ID"/>
</set>
</class>

<class name="ClinicItemType" table="CLINIC_ITEM">
<id name="id" column="CLINIC_ITEM_ID" type="long">
<generator class="assigned"/>
</id>
<property name="clinicCategoryId" column="CLINIC_CATEGORY_ID" type="Integer"/>
<property name="clinicItemName" column="CLINIC_ITEM_NAME" type="string"/>
<set name="setNames" table="SET_ITEM" >
<key column="clinic_item_id"/>
<many-to-many class="SetNameType"
column="SET_NAME_ID"/>
</set>
</class>


Top
 Profile  
 
 Post subject: cascade attribute
PostPosted: Sat Oct 23, 2004 12:14 pm 
Newbie

Joined: Tue Oct 19, 2004 4:18 am
Posts: 9
Hello,

consider using the cascade attribute

Nicolas

_________________
Nicolas Brasseur - Loop Factory - http://www.loop.be


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.