-->
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: Cascade delete on a bidirectionnal association problem
PostPosted: Tue Apr 20, 2010 4:50 am 
Newbie

Joined: Sat Apr 17, 2010 8:31 am
Posts: 3
Hi,

I have two classes "C" and "CR". My problem is that when I delete an object of type "C" the objects of type "CR" are not delete, only the column "chn_uuid" is setted to "null" value Why ?

Code:
public final class C
{
...
  @OneToMany(targetEntity = CR.class,cascade={CascadeType.REMOVE})
  @JoinColumn(name = "chn_uuid")
  private final List<CR> _crList;
...
}

public final class CR
{
...
  @ManyToOne(targetEntity = C.class)
  @JoinColumn(name = "chn_uuid")
  private C_cn;
}





Top
 Profile  
 
 Post subject: Re: Cascade delete on a bidirectionnal association problem
PostPosted: Tue Apr 20, 2010 6:38 am 
Newbie

Joined: Sat Apr 17, 2010 8:31 am
Posts: 3
Nobody can help me ?


Top
 Profile  
 
 Post subject: Re: Cascade delete on a bidirectionnal association problem
PostPosted: Tue Apr 20, 2010 9:17 am 
Newbie

Joined: Tue Apr 20, 2010 9:09 am
Posts: 1
set bidirectional attribute inverse = true.


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.