/** * Return the instance being detached. */ protected PersistenceCapable getDetachedPersistenceCapable() { return sm.getPersistenceCapable(); } }
/** * Return the instance being detached. */ protected PersistenceCapable getDetachedPersistenceCapable() { return sm.getPersistenceCapable(); } }
/** * Return the instance being detached. */ protected PersistenceCapable getDetachedPersistenceCapable() { return sm.getPersistenceCapable(); } }
/** * Return the instance being detached. */ protected PersistenceCapable getDetachedPersistenceCapable() { return sm.getPersistenceCapable(); } }
/** * Return the instance being detached. */ protected PersistenceCapable getDetachedPersistenceCapable() { return sm.getPersistenceCapable(); } }
/** * Restore the given field. If this method returns true, then you need * to use this field manager to replace the given field in the state * manager's instance. */ public boolean restoreField(int field) { if (!_loaded.get(field)) return false; if (_mutable != null && _mutable.get(field)) return true; // copy the saved field over if (_copyField == null) _copyField = new int[1]; _copyField[0] = field; _sm.getPersistenceCapable().pcCopyFields(_copy, _copyField); return false; }
/** * Restore the given field. If this method returns true, then you need * to use this field manager to replace the given field in the state * manager's instance. */ public boolean restoreField(int field) { if (!_loaded.get(field)) return false; if (_mutable != null && _mutable.get(field)) return true; // copy the saved field over if (_copyField == null) _copyField = new int[1]; _copyField[0] = field; _sm.getPersistenceCapable().pcCopyFields(_copy, _copyField); return false; }
/** * Restore the given field. If this method returns true, then you need * to use this field manager to replace the given field in the state * manager's instance. */ public boolean restoreField(int field) { if (!_loaded.get(field)) return false; if (_mutable != null && _mutable.get(field)) return true; // copy the saved field over if (_copyField == null) _copyField = new int[1]; _copyField[0] = field; _sm.getPersistenceCapable().pcCopyFields(_copy, _copyField); return false; }
/** * Restore the given field. If this method returns true, then you need * to use this field manager to replace the given field in the state * manager's instance. */ public boolean restoreField(int field) { if (!_loaded.get(field)) return false; if (_mutable != null && _mutable.get(field)) return true; // copy the saved field over if (_copyField == null) _copyField = new int[1]; _copyField[0] = field; _sm.getPersistenceCapable().pcCopyFields(_copy, _copyField); return false; }
/** * Restore the given field. If this method returns true, then you need * to use this field manager to replace the given field in the state * manager's instance. */ public boolean restoreField(int field) { if (!_loaded.get(field)) return false; if (_mutable != null && _mutable.get(field)) return true; // copy the saved field over if (_copyField == null) _copyField = new int[1]; _copyField[0] = field; _sm.getPersistenceCapable().pcCopyFields(_copy, _copyField); return false; }
/** * Restore the given field. If this method returns true, then you need * to use this field manager to replace the given field in the state * manager's instance. */ public boolean restoreField(int field) { // if the given field needs to be unloaded, return true so that it gets // replaced with a default value if (_unloaded.get(field)) return true; // if the field was not saved, it must not have gotten dirty; just // return false so that the current value is kept if (_saved == null || !_saved.get(field)) return false; // copy the saved field over if (_copyField == null) _copyField = new int[1]; _copyField[0] = field; _sm.getPersistenceCapable().pcCopyFields(getState(), _copyField); return false; }
/** * Restore the given field. If this method returns true, then you need * to use this field manager to replace the given field in the state * manager's instance. */ public boolean restoreField(int field) { // if the given field needs to be unloaded, return true so that it gets // replaced with a default value if (_unloaded.get(field)) return true; // if the field was not saved, it must not have gotten dirty; just // return false so that the current value is kept if (_saved == null || !_saved.get(field)) return false; // copy the saved field over if (_copyField == null) _copyField = new int[1]; _copyField[0] = field; _sm.getPersistenceCapable().pcCopyFields(getState(), _copyField); return false; }
/** * Record that we should save any fields that change from this point * forward. */ void saveFields(boolean immediate) { if (_broker.getRestoreState() == RestoreState.RESTORE_NONE && (_flags & FLAG_INVERSES) == 0) return; _flags |= FLAG_SAVE; if (immediate) { for (int i = 0, len = _loaded.length(); i < len; i++) saveField(i); _flags &= ~FLAG_SAVE; // OPENJPA-659 // record a saved field manager even if no field is currently loaded // as existence of a SaveFieldManager is critical for a dirty check if (_saved == null) _saved = new SaveFieldManager(this, getPersistenceCapable(), getDirty()); } }
/** * Record that we should save any fields that change from this point * forward. */ void saveFields(boolean immediate) { if (_broker.getRestoreState() == RestoreState.RESTORE_NONE && (_flags & FLAG_INVERSES) == 0) return; _flags |= FLAG_SAVE; if (immediate) { for (int i = 0, len = _loaded.length(); i < len; i++) saveField(i); _flags &= ~FLAG_SAVE; // OPENJPA-659 // record a saved field manager even if no field is currently loaded // as existence of a SaveFieldManager is critical for a dirty check if (_saved == null) _saved = new SaveFieldManager(this, getPersistenceCapable(), getDirty()); } }
@Override void initialize(StateManagerImpl context, PCState previous) { // mark r/w ok, remove from management context.unproxyFields(); context.getPersistenceCapable().pcReplaceStateManager(null); context.getBroker().setStateManager(context.getId(), context, BrokerImpl.STATUS_TRANSIENT); }
@Override void initialize(StateManagerImpl context, PCState previous) { // mark r/w ok, remove from management context.unproxyFields(); context.getPersistenceCapable().pcReplaceStateManager(null); context.getBroker().setStateManager(context.getId(), context, BrokerImpl.STATUS_TRANSIENT); }
@Override void initialize(StateManagerImpl context, PCState previous) { // mark r/w ok, remove from management context.unproxyFields(); context.getPersistenceCapable().pcReplaceStateManager(null); context.getBroker().setStateManager(context.getId(), context, BrokerImpl.STATUS_TRANSIENT); }
@Override void initialize(StateManagerImpl context, PCState previous) { // mark r/w ok, remove from management context.unproxyFields(); context.getPersistenceCapable().pcReplaceStateManager(null); context.getBroker().setStateManager(context.getId(), context, BrokerImpl.STATUS_TRANSIENT); }
void initialize(StateManagerImpl context) { // mark r/w ok, remove from management context.unproxyFields(); context.getPersistenceCapable().pcReplaceStateManager(null); context.getBroker().setStateManager(context.getId(), context, BrokerImpl.STATUS_TRANSIENT); } }
/** * Used to prepare a detachable instance that does not externalize * detached state. */ static boolean preSerialize(StateManagerImpl sm) { if (!sm.isPersistent()) return false; if (sm.getBroker().getConfiguration().getCompatibilityInstance() .getFlushBeforeDetach()) { flushDirty(sm); } ClassMetaData meta = sm.getMetaData(); boolean setState = meta.getDetachedState() != null && !ClassMetaData.SYNTHETIC.equals(meta.getDetachedState()); BitSet idxs = (setState) ? new BitSet(meta.getFields().length) : null; preDetach(sm.getBroker(), sm, idxs, false, true); if (setState) { sm.getPersistenceCapable().pcSetDetachedState(getDetachedState (sm, idxs)); return false; // don't null state } return true; }