users@glassfish.java.net

Re: problem removing entity

From: <glassfish_at_javadesktop.org>
Date: Mon, 18 Jun 2007 07:32:07 PDT

You have to call remove on the managed entity - the object returned from the merge call is managed.

[code]
Unit managedUnit = em.merge(unit);
em.remove(managedUnit);
[/code]
The persist api will take a new entity and make it managed, the merge api will take a detached object and return the managed object.

Best Regards,
Chris
[Message sent by forum member 'chris_delahunt' (chris_delahunt)]

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