/** * Gets the target slices for the given StateManager. */ public static SliceInfo getSlicesByPolicy(OpenJPAStateManager sm, DistributedConfiguration conf, Object ctx) { return getSlicesByPolicy(sm.getPersistenceCapable(), conf, ctx); }
/** * Gets the target slices for the given StateManager. */ public static SliceInfo getSlicesByPolicy(OpenJPAStateManager sm, DistributedConfiguration conf, Object ctx) { return getSlicesByPolicy(sm.getPersistenceCapable(), conf, ctx); }
/** * Gets the target slices for the given StateManager. */ public static SliceInfo getSlicesByPolicy(OpenJPAStateManager sm, DistributedConfiguration conf, Object ctx) { return getSlicesByPolicy(sm.getPersistenceCapable(), conf, ctx); }
private static void clearStateManager(ProxyCollection proxy) { OpenJPAStateManager sm = proxy.getOwner(); if (sm != null) { sm.getPersistenceCapable().pcReplaceStateManager(null); } } }
private static void clearStateManager(ProxyCollection proxy) { OpenJPAStateManager sm = proxy.getOwner(); if (sm != null) { sm.getPersistenceCapable().pcReplaceStateManager(null); } } }
private static void clearStateManager(ProxyCollection proxy) { OpenJPAStateManager sm = proxy.getOwner(); if (sm != null) { sm.getPersistenceCapable().pcReplaceStateManager(null); } } }
private static void clearStateManager(ProxyCollection proxy) { OpenJPAStateManager sm = proxy.getOwner(); if (sm != null) { sm.getPersistenceCapable().pcReplaceStateManager(null); } } }
/** * Sets this receiver as the given StateManager's internal instance-level * data. If the given StateManager had existing instance-level data that is * not a SliceInfo then raise an exception. */ public SliceInfo setInto(OpenJPAStateManager sm) { if (sm == null) throw new NullPointerException(); Object previous = sm.setImplData(this, true); if (previous == null || previous instanceof SliceInfo) return (SliceInfo)previous; throw new InternalException(_loc.get("unknown-impl-data", previous, previous.getClass().getName(), sm.getPersistenceCapable()) .getMessage()); } }
/** * Sets this receiver as the given StateManager's internal instance-level * data. If the given StateManager had existing instance-level data that is * not a SliceInfo then raise an exception. */ public SliceInfo setInto(OpenJPAStateManager sm) { if (sm == null) throw new NullPointerException(); Object previous = sm.setImplData(this, true); if (previous == null || previous instanceof SliceInfo) return (SliceInfo)previous; throw new InternalException(_loc.get("unknown-impl-data", previous, previous.getClass().getName(), sm.getPersistenceCapable()) .getMessage()); } }
/** * Sets this receiver as the given StateManager's internal instance-level * data. If the given StateManager had existing instance-level data that is * not a SliceInfo then raise an exception. */ public SliceInfo setInto(OpenJPAStateManager sm) { if (sm == null) throw new NullPointerException(); Object previous = sm.setImplData(this, true); if (previous == null || previous instanceof SliceInfo) return (SliceInfo)previous; throw new InternalException(_loc.get("unknown-impl-data", previous, previous.getClass().getName(), sm.getPersistenceCapable()) .getMessage()); } }
private String assignSlice(OpenJPAStateManager sm) { Object pc = sm.getPersistenceCapable(); DistributionPolicy policy = _conf.getDistributionPolicyInstance(); List<String> sliceNames = _conf.getActiveSliceNames(); String slice =policy.distribute(pc, sliceNames, getContext()); if (!sliceNames.contains(slice)) { throw new UserException(_loc.get("bad-policy-slice", new Object[] { policy.getClass().getName(), slice, pc, sliceNames })); } sm.setImplData(slice, true); return slice; }
protected void setObjectId(List vals, Column[] autoAssign, DBIdentifier[] autoAssignColNames, RowImpl row) throws SQLException{ OpenJPAStateManager sm = row.getPrimaryKey(); ClassMapping mapping = (ClassMapping) sm.getMetaData(); Object val = null; for (int i = 0; i < autoAssign.length; i++) { if (_dict.supportsGetGeneratedKeys && vals != null && vals.size() > 0) val = vals.get(i); else val = _dict.getGeneratedKey(autoAssign[i], _conn); mapping.assertJoinable(autoAssign[i]).setAutoAssignedValue(sm, _store, autoAssign[i], val); } sm.setObjectId( ApplicationIds.create(sm.getPersistenceCapable(), mapping)); }
protected void setObjectId(List vals, Column[] autoAssign, DBIdentifier[] autoAssignColNames, RowImpl row) throws SQLException{ OpenJPAStateManager sm = row.getPrimaryKey(); ClassMapping mapping = (ClassMapping) sm.getMetaData(); Object val = null; for (int i = 0; i < autoAssign.length; i++) { if (_dict.supportsGetGeneratedKeys && vals != null && vals.size() > 0) val = vals.get(i); else val = _dict.getGeneratedKey(autoAssign[i], _conn); mapping.assertJoinable(autoAssign[i]).setAutoAssignedValue(sm, _store, autoAssign[i], val); } sm.setObjectId( ApplicationIds.create(sm.getPersistenceCapable(), mapping)); }
public boolean initialize(OpenJPAStateManager sm, PCState state, FetchConfiguration fetch, Object context) { ConnectionInfo info = (ConnectionInfo) context; try { return initializeState(sm, state, (JDBCFetchConfiguration) fetch, info); } catch (ClassNotFoundException cnfe) { throw new UserException(cnfe); } catch (SQLException se) { throw SQLExceptions.getStore(se, Exceptions.toString(sm.getPersistenceCapable()), _dict, fetch.getReadLockLevel()); } }
public boolean initialize(OpenJPAStateManager sm, PCState state, FetchConfiguration fetch, Object context) { ConnectionInfo info = (ConnectionInfo) context; try { return initializeState(sm, state, (JDBCFetchConfiguration) fetch, info); } catch (ClassNotFoundException cnfe) { throw new UserException(cnfe); } catch (SQLException se) { throw SQLExceptions.getStore(se, Exceptions.toString(sm.getPersistenceCapable()), _dict, fetch.getReadLockLevel()); } }
public boolean initialize(OpenJPAStateManager sm, PCState state, FetchConfiguration fetch, Object context) { ConnectionInfo info = (ConnectionInfo) context; try { return initializeState(sm, state, (JDBCFetchConfiguration) fetch, info); } catch (ClassNotFoundException cnfe) { throw new UserException(cnfe); } catch (SQLException se) { throw SQLExceptions.getStore(se, Exceptions.toString(sm.getPersistenceCapable()), _dict, fetch.getReadLockLevel()); } }
public boolean initialize(OpenJPAStateManager sm, PCState state, FetchConfiguration fetch, Object context) { ConnectionInfo info = (ConnectionInfo) context; try { return initializeState(sm, state, (JDBCFetchConfiguration) fetch, info); } catch (ClassNotFoundException cnfe) { throw new UserException(cnfe); } catch (SQLException se) { throw SQLExceptions.getStore(se, Exceptions.toString(sm.getPersistenceCapable()), _dict, fetch.getReadLockLevel()); } }
/** * Attach the given pc. */ private Object attachInPlace(AttachManager manager, StateManagerImpl sm, ValueMetaData vmd, Object pc) { if (pc == null) return null; Object attached = manager.getAttachedCopy(pc); if (attached != null) return attached; OpenJPAStateManager into = manager.getBroker().getStateManager(pc); PersistenceCapable intoPC = (into == null) ? null : into.getPersistenceCapable(); if (vmd.isEmbedded()) return manager.attach(pc, intoPC, sm, vmd, false); return manager.attach(pc, intoPC, null, null, false); }
/** * Attach the given pc. */ private Object attachInPlace(AttachManager manager, StateManagerImpl sm, ValueMetaData vmd, Object pc) { if (pc == null) return null; Object attached = manager.getAttachedCopy(pc); if (attached != null) return attached; OpenJPAStateManager into = manager.getBroker().getStateManager(pc); PersistenceCapable intoPC = (into == null) ? null : into.getPersistenceCapable(); if (vmd.isEmbedded()) return manager.attach(pc, intoPC, sm, vmd, false); return manager.attach(pc, intoPC, null, null, false); }
/** * Attach the given pc. */ private Object attachInPlace(AttachManager manager, StateManagerImpl sm, ValueMetaData vmd, Object pc) { if (pc == null) return null; Object attached = manager.getAttachedCopy(pc); if (attached != null) return attached; OpenJPAStateManager into = manager.getBroker().getStateManager(pc); PersistenceCapable intoPC = (into == null) ? null : into.getPersistenceCapable(); if (vmd.isEmbedded()) return manager.attach(pc, intoPC, sm, vmd, false); return manager.attach(pc, intoPC, null, null, false); }