Home » JDO » PersistenceCapable » jdoReplaceStateManager(sm) - JDO PersistenceCapable's method

jdoReplaceStateManager(sm) - JDO PersistenceCapable's method

Method
javax.jdo.spi.PersistenceCapable
void jdoReplaceStateManager(
  StateManager sm
)

This method sets the StateManager instance that manages the state of this instance. This method is normally used by the StateManager during the process of making an instance persistent, transient, or transactional. The caller of this method must have JDOPermission for the instance, if the instance is not already owned by a StateManager. If the parameter is null, and the StateManager approves the change, then the jdoFlags field will be reset to READ_WRITE_OK. If the parameter is not null, and the security manager approves the change, then the jdoFlags field will be reset to LOAD_REQUIRED.
Parameters:
sm - The StateManager which will own this instance, or null to reset the instance to transient state
Throws:
SecurityException - if the caller does not have JDOPermission
Since:
JDO 1.0
See Also:
JDOPermission

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.