-->
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: Cascade problem - Removing children objects with save parent
PostPosted: Thu Sep 18, 2008 9:45 am 
Newbie

Joined: Thu Sep 18, 2008 9:26 am
Posts: 2
I have a parent (Rule) object with many children (RuleDependency) objects. I’m trying to delete same child objects removing from the Collection/List in the parent object Rule through invoking the Save in. I have a so similar code using mapping by XML that works perfectly (cascade="all-delete-orphan" lazy="false" inverse="true") with NHibernate, but with JPA God helps me.

Parent
Code:
@Entity
@Table(name = "RULE")
public class Rule extends BeanBase {
  @OneToMany(mappedBy = "rule", cascade = CascadeType.ALL, targetEntity = RuleDependency.class)
  //   @OnDelete(action = OnDeleteAction.CASCADE) ALSO doesn’t work
  private List<RuleDependency> dependencies;

CHILD
Code:
@Entity
@Table(name = "RULE_DEPENDENCY")
public class RuleDependency extends BeanBase {
  @ManyToOne()
  @JoinColumn(name = "RULE_ID", referencedColumnName="ID", nullable = false)
  private Rule rule;


[b]Hibernate version:3.2.6 annotation 3.3.1


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 18, 2008 12:17 pm 
Newbie

Joined: Thu Sep 18, 2008 9:26 am
Posts: 2
Segundo o link a JPA ainda não suporta esta funcionalidade, certo?
http://forums.java.net/jive/thread.jspa?messageID=212495&tstart=0


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.