@ Override public final void jdoReplaceStateManager ( javax . jdo . spi . StateManager sm ) { // throws exception if current sm didn't request the change if ( jdoStateManager != null ) { jdoStateManager = jdoStateManager . replacingStateManager ( this , sm ) ; } else { // the following will throw an exception if not authorized JDOImplHelper . checkAuthorizedStateManager ( sm ) ; jdoStateManager = sm ; this . jdoFlags = LOAD_REQUIRED ; } }
The generated method asks the current StateManager to approve the change or validates the caller s authority to set the state .