public Seq getDataStoreIdSequence(ClassMetaData forClass) { return _master.getDataStoreIdSequence(forClass); }
public Object newDataStoreId(Object oidVal, ClassMetaData meta) { return _master.newDataStoreId(oidVal, meta); }
public void setContext(StoreContext ctx) { setContext(ctx, (JDBCConfiguration) ctx.getConfiguration()); }
} else if (oid instanceof OpenJPAId && !((OpenJPAId) oid).hasSubclasses()) { Boolean custom = customLoad(sm, mapping, state, fetch); if (custom != null) return custom.booleanValue(); res = getInitializeStateResult(sm, mapping, fetch, Select.SUBS_EXACT); if (res == null && !selectPrimaryKey(sm, mapping, fetch)) return false; if (isEmptyResult(res)) return false; } else { if (mappings.length == 1) { mapping = mappings[0]; Boolean custom = customLoad(sm, mapping, state, fetch); if (custom != null) return custom.booleanValue(); res = getInitializeStateResult(sm, mapping, fetch, Select.SUBS_ANY_JOINABLE); if (res == null && !selectPrimaryKey(sm, mapping, fetch)) return false; } else res = getInitializeStateUnionResult(sm, mapping, mappings, fetch); if (isEmptyResult(res)) return false; if ((type = getType(res, mapping)) == null) {
if(needClassCondition(mapping, subs, sm)) { joinedSupers = getJoinedSupers(sel, mapping, subs, outer); FieldMapping eagerToMany = createEagerSelects(sel, mapping, sm, fields, fetch, eager); int seld = selectBaseMappings(sel, mapping, mapping, sm, fields, fetch, eager, eagerToMany, ident, joinedSupers); selectSubclassMappings(sel, mapping, sm, fetch); if (sm != null) sel.setDistinct(false);
public boolean assignObjectId(OpenJPAStateManager sm, boolean preFlush) { ClassMetaData meta = sm.getMetaData(); if (meta.getIdentityType() == ClassMetaData.ID_APPLICATION) return ApplicationIds.assign(sm, this, preFlush); // datastore identity Object val = ImplHelper.generateIdentityValue(_ctx, meta, JavaTypes.LONG); if (val == null && meta.getIdentityStrategy() != ValueStrategies.NATIVE) return false; if (val == null) val = getDataStoreIdSequence(meta).next(_ctx, meta); sm.setObjectId(newDataStoreId(val, meta)); return true; }
if ((sm == null || sm.getPCState() == PCState.TRANSIENT) && (subs == Select.SUBS_JOINABLE || subs == Select.SUBS_NONE)) { loadSubclasses(mapping); Joins joins = (outer) ? sel.newOuterJoins() : null; joinedSupers = mapping.getDiscriminator().addClassConditions(sel, FieldMapping eagerToMany = createEagerSelects(sel, mapping, sm, fields, fetch, eager); int seld = selectBaseMappings(sel, mapping, mapping, sm, fields, fetch, eager, eagerToMany, ident, joinedSupers); selectSubclassMappings(sel, mapping, sm, fetch); if (sm != null) sel.setDistinct(false);
return null; FieldMapping eagerToMany = createEagerSelects(sel, mapping.getJoinablePCSuperclassMapping(), sm, fields, fetch, eager); if (mode == EagerFetchModes.EAGER_NONE) continue; if (!requiresSelect(fms[i], sm, fields, fetch)) continue;
public Connection getConnection() { connect(true); return _conn; }
public Object getClientConnection() { return new ClientConnection(getConnection()); }
public boolean exists(OpenJPAStateManager sm, Object context) { // add where conditions on base class to avoid joins if subclass // doesn't use oid as identifier ClassMapping mapping = (ClassMapping) sm.getMetaData(); return exists(mapping, sm.getObjectId(), context); }
protected StoreManager newStoreManager() { return new JDBCStoreManager(); }
/** * Connect to the db. */ private void connect(boolean ref) { _ctx.lock(); try { // connect if the connection is currently null, or if // the connection has been closed out from under us if (_conn == null) _conn = connectInternal(); if (ref) _conn.ref(); } catch (SQLException se) { throw SQLExceptions.getStore(se, _dict); } finally { _ctx.unlock(); } }
} else if (oid instanceof OpenJPAId && !((OpenJPAId) oid).hasSubclasses()) { Boolean custom = customLoad(sm, mapping, state, fetch); if (custom != null) return custom.booleanValue(); res = getInitializeStateResult(sm, mapping, fetch, Select.SUBS_EXACT); if (res == null && !selectPrimaryKey(sm, mapping, fetch)) return false; if (isEmptyResult(res)) return false; } else { if (mappings.length == 1) { mapping = mappings[0]; Boolean custom = customLoad(sm, mapping, state, fetch); if (custom != null) return custom.booleanValue(); res = getInitializeStateResult(sm, mapping, fetch, Select.SUBS_ANY_JOINABLE); if (res == null && !selectPrimaryKey(sm, mapping, fetch)) return false; } else res = getInitializeStateUnionResult(sm, mapping, mappings, fetch); if (isEmptyResult(res)) return false; if ((type = getType(res, mapping)) == null) {
if(needClassCondition(mapping, subs, sm)) { joinedSupers = getJoinedSupers(sel, mapping, subs, outer); FieldMapping eagerToMany = createEagerSelects(sel, mapping, sm, fields, fetch, eager); int seld = selectBaseMappings(sel, mapping, mapping, sm, fields, fetch, eager, eagerToMany, ident, joinedSupers); selectSubclassMappings(sel, mapping, sm, fetch); if (sm != null) sel.setDistinct(false);
public boolean assignObjectId(OpenJPAStateManager sm, boolean preFlush) { ClassMetaData meta = sm.getMetaData(); if (meta.getIdentityType() == ClassMetaData.ID_APPLICATION) return ApplicationIds.assign(sm, this, preFlush); // datastore identity Object val = ImplHelper.generateIdentityValue(_ctx, meta, JavaTypes.LONG); if (val == null && meta.getIdentityStrategy() != ValueStrategies.NATIVE) return false; if (val == null) val = getDataStoreIdSequence(meta).next(_ctx, meta); sm.setObjectId(newDataStoreId(val, meta)); return true; }
return null; FieldMapping eagerToMany = createEagerSelects(sel, mapping.getJoinablePCSuperclassMapping(), sm, fields, fetch, eager); if (mode == EagerFetchModes.EAGER_NONE) continue; if (!requiresSelect(fms[i], sm, fields, fetch)) continue;
public Connection getConnection() { connect(true); return _conn; }
public Object getClientConnection() { return new ClientConnection(getConnection()); }
public boolean exists(OpenJPAStateManager sm, Object context) { // add where conditions on base class to avoid joins if subclass // doesn't use oid as identifier ClassMapping mapping = (ClassMapping) sm.getMetaData(); return exists(mapping, sm.getObjectId(), context); }