ObjectDB ObjectDB

detachCopyAll(pcs) - JDO PersistenceManager's method

Method
javax.jdo.PersistenceManager
T[] detachCopyAll(
  T... pcs
)

Detach the specified instances from the PersistenceManager. The flags for detachment (DETACH_LOAD_FIELDS and DETACH_UNLOAD_FIELDS) and the active fetch groups determine the scope of fetching for the graph of instances reachable from the pcs parameter. The state of fields in the affected instances is as specified by the FetchPlan. The objects returned can be manipulated and re-attached with makePersistentAll(Object[]). The detached instances will be unmanaged copies of the specified parameters, and are suitable for serialization and manipulation outside of a JDO environment. When detaching instances, only fields in the current FetchPlan will be traversed. Thus, to detach a graph of objects, relations to other persistent instances must either be in the default-fetch-group, or in the current custom FetchPlan.
Parameters:
pcs - the instances to detach
Returns:
the detached instances
Throws:
JDOUserException - if any of the instances to be detached do not implement the javax.jdo.spi.Detachable interface.
Since:
JDO 2.0
See Also:
makePersistentAll(Object[])
getFetchPlan