Quote from the delete method
// We need to merge this object to the database session, so that it
// can be deleted. We do this by actually fetching the object first.
Object entity = em.find(pojo.getClass(), pojo.getId());
// Now when we have a fresh instance of the entity which is attached
// to the JPA provider's session, we can remove the entity.
em.remove(entity);
If find returns null, then an IllegalArgumentException is thrown. This should
be handled in a different way.
Original issue reported on code.google.com by kimp...@gmail.com on 9 May 2011 at 12:17
Original issue reported on code.google.com by
kimp...@gmail.com
on 9 May 2011 at 12:17