[jboss-dev-forums] [EJB3 Development] - Re: EntityManager.remove() throws java.lang.IllegalArgumentException: Removing a detached instance ?
Ibrahim Abu Ghosh
do-not-reply at jboss.com
Wed Mar 30 07:45:44 EDT 2011
Ibrahim Abu Ghosh [http://community.jboss.org/people/iabughosh] created the discussion
"Re: EntityManager.remove() throws java.lang.IllegalArgumentException: Removing a detached instance ?"
To view the discussion, visit: http://community.jboss.org/message/596501#596501
--------------------------------------------------------------
thats right, or you can find the entity by primary key then remove it like this :
YourEntity e = em.find(YourEntity.class, entityId);//e is the managed entity
em.remove(e);
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/596501#596501]
Start a new discussion in EJB3 Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2030]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20110330/7db66d31/attachment.html
More information about the jboss-dev-forums
mailing list