-->
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: Circular relation with annotations
PostPosted: Wed Jan 13, 2010 10:41 am 
Newbie

Joined: Wed Jan 13, 2010 10:28 am
Posts: 4
hi,

i got a probleme when in want to delete an item, i want a true delete but in my console, i only got this :
Code:
update TechnicalSkillOnsItem set parent=null where parent=? and id=?

it only sets null to the item but it does not delete it

my mapping :


Code:
class TItem
   
        @OneToMany(cascade = CascadeType.MERGE)
   @JoinColumn(name="parent")
   @Cascade(org.hibernate.annotations.CascadeType.DELETE_ORPHAN)
   private List<TItem> children;
   
   @ManyToOne(cascade=CascadeType.MERGE)
   @JoinColumn(name="parent")
   @Cascade(org.hibernate.annotations.CascadeType.DELETE_ORPHAN)   
   private TItem parent;

   @ManyToOne(cascade=CascadeType.MERGE)
   @JoinColumn(name="tItemName")
   private TItemName tItemName;


so i got an objet TItem who got children
i want to delete a child, so i remove a child to my TItem (which is its parent) and save the parent

thx for helps ;)


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.