[jboss-user] [EJB 3.0] - Re: javax.persistence.EntityNotFoundException: deleted entit

Wolfgang Knauf do-not-reply at jboss.com
Mon Mar 23 10:30:20 EDT 2009


Hi,

I didn't see that you have a self referencing relationship, sorry for that.

What is the expected behavior? Do you want to delete all related events if one event is removed? This makes only sense if you build a tree structure. If you have a net of relationships, you shouldn't cascade the removal.

If you want to cascade, I think you have to do some recursion and use the code Jochen provided to remove all childs of all childs of all childs of ... 

If you don't want to cascade, Jochen's code should work.

Hope this helps

Wolfgang

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4220268#4220268

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4220268



More information about the jboss-user mailing list