Home » JDO » JDOImplHelper » newInstance(pcClass, sm, oid) - JDO JDOImplHelper's method

newInstance(pcClass, sm, oid) - JDO JDOImplHelper's method

Method
javax.jdo.spi.JDOImplHelper
PersistenceCapable newInstance(
  Class pcClass,
  StateManager sm,
  Object oid
)

Create a new instance of the class and assign its jdoStateManager and key values from the ObjectId. If the oid parameter is null, no key values are copied. The new instance has its jdoFlags set to LOAD_REQUIRED.
Parameters:
pcClass - the PersistenceCapable class.
sm - the StateManager which will own the new instance.
oid - the ObjectId instance from which to copy key field values.
Returns:
the new instance, or null if the class is not registered.
Since:
JDO 1.0
See Also:
PersistenceCapable.jdoNewInstance(StateManager sm, Object oid)

This documentation page is derived (with some adjustments) from the JDO 2.2 API
and is available under the terms of the Apache License, v. 2.0.