Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JBoss User Help »

[jboss-user] [EJB 3.0] - deletion of few elements in one to many
 collection.

scott.stark@jboss.org

2007-07-22


Hi I'm trying to remove a few child elements from a onetomany relationship.
like :
| for (Role r : presentRolesToRemove.keySet()) {
|  focusSubject.getActors().remove(presentRolesToRemove.get(r));
| }
|
(presentRolesToRemove being a Map<Role,Actor>)
But doing a em.merge(focusSubject); does not remove the childs from the database. Should I do a em.delete(presentRolesToRemove.get(r)); explicitely within the for-loop?
Or is there annotation to circumvent this manual deletion?

Thanks in advance.
jeroen.

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

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4066472
_______________________________________________
jboss-user mailing list
jboss-user@(protected)
https://lists.jboss.org/mailman/listinfo/jboss-user
©2008 junlu.com - Jax Systems, LLC, U.S.A.