users@glassfish.java.net

Re: Toplink not cascad deleted OneToMany objects when merge() called

From: <glassfish_at_javadesktop.org>
Date: Wed, 13 Feb 2008 05:28:31 PST

CascadeType.REMOVE means that when the parent object is removed the persistence provider should also remove its related objects. I believe you are looking for TopLink to delete the removed orphan objects.

In TopLink terminology we call this private-owned relationships where any objects removed from the relationship should be deleted upon commit of the transaction.

In a JPA 1.0 solution you must manually call em.remove for each port you remove from the permissions's collection.

Doug
[Message sent by forum member 'djclarke' (djclarke)]

http://forums.java.net/jive/thread.jspa?messageID=258713