What would be the easiest way to detach a specific JPA Entity Bean that was acquired through an EntityManager. Alternatively, could I have a query return detached objects in
If using EclipseLink you also have the options,
EclipseLink
Use the Query hint, eclipselink.maintain-cache"="false - all returned objects will be detached.
eclipselink.maintain-cache"="false
Use the EclipseLink JpaEntityManager copy() API to copy the object to the desired depth.
JpaEntityManager
copy()