users@glassfish.java.net

Re: JPA missing hibernate's "delete-orhpan" cascading type

From: <glassfish_at_javadesktop.org>
Date: Mon, 16 Apr 2007 06:03:40 PDT

Hallo,

scenario is really simple, imagine any class with some one-to-many relations.
There is method EntityManager.merge(), which should merge changes made in detached entity to persistent context.
However, this works only as long these changes are updates or insertions.
I would like to use Rich Client Model approach. Calls of my methods on a detached entity may result in deletions of some related entities. Then, I do not see pure JPA way how to again synchronize state of my entity with persistent context.

Hibernate solves it with "delete orphan" feature, Toplink has notion of "private ownership", which solve the problem. JPA spec mentions use without j2ee servers, but i suspect it actually does not work.

bye, m.
[Message sent by forum member 'mstanik' (mstanik)]

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