-->
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.  [ 3 posts ] 
Author Message
 Post subject: Delete on One to many relationship
PostPosted: Mon Sep 29, 2008 6:12 am 
Newbie

Joined: Mon Sep 29, 2008 4:02 am
Posts: 1
I am using following code and when i am updating ,child table creates new additional rows . Previous rows r not deleted before update.

Code:
[b] <set
        name="appUserRoles"
      cascade="all"
      inverse="false"
      lazy="false"
    >
       
        <key>
            <column name="USER_ID" />
        </key>
        <one-to-many class="com.infotech.login.model.AppUserRole"/>
    </set>[/b]


Please solve my problem .


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 29, 2008 9:55 am 
Expert
Expert

Joined: Mon Nov 26, 2007 2:29 pm
Posts: 443
You need a cascade property on your set, with the method(s) you plan to be cascaded (delete, update, save-update, all) as a value.

_________________
Gonzalo Díaz


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 29, 2008 11:17 am 
Beginner
Beginner

Joined: Wed Sep 24, 2008 5:44 pm
Posts: 34
Hmmm... How are you deleting your rows?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.