hello,
does someone know a way to handle deletes of entities which are part of a 
manytomany relationship. especially when cascading deletes. 

I have two entity classes A and B.
A references a set of B, and B references a set of A. deletes on B should be 
cascaded to all As referenced by B. Is there a way to have the entitymanager 
cascade deletes on A to B only if there are no more As dependent on B?

The only way I know to do this, is to check the state of the relationship 
before removal myself. The problem is, that this logic would be outside the 
entitybean, since there is a entitymanager needed to delete Bs, which are no 
longer in use by other As. Of course I could create a entitybean method which 
would require the entitymanager as parameter, but i think, i hope there is a 
better way, i'm not aware of.

Any comments on this topic are welcome.

thanx in advance, milan wölke

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

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


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to