| Re: [eclipselink-users] problem with remove on bidirectional oneToMany entities |
Hello Yannick,
father.getSonsCollection().remove(son); is equivalent to
List<Son> sons = father.getSonsCollection(); sons.remove(son); father.setSonsCollection(sons);
so entityManager.merge(father) will be required in either case if father is detached. Try em.contains(father) before the merge to see if it is managed or not. If father is a managed entity, the change to the sons collection should be picked up without the merge call.
Hi,
Best regards,
Yannick