public JDBCFetchConfiguration addFetchInnerJoin(String field) { try { getJDBCDelegate().addFetchInnerJoin(field); return this; } catch (RuntimeException re) { throw translate(re); } }
public JDBCFetchConfiguration addFetchInnerJoins(Collection fields) { try { getJDBCDelegate().addFetchInnerJoins(fields); return this; } catch (RuntimeException re) { throw translate(re); } } @Override
public JDBCFetchConfiguration addJoin(String field) { try { getJDBCDelegate().addJoin(field); return this; } catch (RuntimeException re) { throw translate(re); } }
public void copy(FetchConfiguration fetch) { super.copy(fetch); JDBCFetchConfiguration jf = (JDBCFetchConfiguration) fetch; setEagerFetchMode(jf.getEagerFetchMode()); setSubclassFetchMode(jf.getSubclassFetchMode()); setResultSetType(jf.getResultSetType()); setFetchDirection(jf.getFetchDirection()); setLRSSize(jf.getLRSSize()); setJoinSyntax(jf.getJoinSyntax()); addJoins(jf.getJoins()); setIgnoreDfgForFkSelect(jf.getIgnoreDfgForFkSelect()); }
rsType = ResultSet.TYPE_FORWARD_ONLY; else if (rsType == -1) rsType = fetch.getResultSetType(); if (rsConcur == -1) rsConcur = ResultSet.CONCUR_READ_ONLY; setParameters(stmnt); if (fetch != null) { if (fetch.getFetchBatchSize() > 0) stmnt.setFetchSize(fetch.getFetchBatchSize()); if (rsType != ResultSet.TYPE_FORWARD_ONLY && fetch.getFetchDirection() != ResultSet.FETCH_FORWARD) stmnt.setFetchDirection(fetch.getFetchDirection());
getFetchConfiguration(); if (exps[0].fetchPaths != null) { fetch.addFields(Arrays.asList(exps[0].fetchPaths)); fetch.addJoins(Arrays.asList(exps[0].fetchPaths)); fetch.addFetchInnerJoins(Arrays.asList(exps[0].fetchInnerPaths)); int subclassMode = fetch.getSubclassFetchMode((ClassMapping) base); DBDictionary dict = _store.getDBDictionary(); long start = (mappings.length == 1 && dict.supportsSelectStartIndex)
return null; if (fetch.getFetchBatchSize() < 0) return null; eagerMode = Math.min(eagerMode, fetch.getEagerFetchMode()); if (eagerMode != fetch.EAGER_PARALLEL) return null; BitSet paged = null; for (int i = 0; i < fms.length; i++) { if (fetch.requiresFetch(fms[i]) != FetchConfiguration.FETCH_LOAD) continue;
/** * Select a union of the data for the given instance from possible concrete * mappings and return the result. */ private Result getInitializeStateUnionResult(final OpenJPAStateManager sm, ClassMapping mapping, final ClassMapping[] mappings, final JDBCFetchConfiguration fetch) throws SQLException { final JDBCStoreManager store = this; final int eager = Math.min(fetch.getEagerFetchMode(), JDBCFetchConfiguration.EAGER_JOIN); Union union = _sql.newUnion(mappings.length); union.setExpectedResultCount(1, false); if (fetch.getSubclassFetchMode(mapping) != fetch.EAGER_JOIN) union.abortUnion(); union.select(new Union.Selector() { public void select(Select sel, int i) { sel.select(mappings[i], Select.SUBS_ANY_JOINABLE, store, fetch, eager); sel.wherePrimaryKey(sm.getObjectId(), mappings[i], store); } }); return union.execute(this, fetch); }
eager = Math.min(eager, fetch.getEagerFetchMode()); FieldMapping eagerToMany = createEagerSelects(sel, mapping, sm, fields, fetch, eager); fetch.traverseJDBC(eagerToMany), eager);
public JDBCFetchConfiguration clearJoins() { try { getJDBCDelegate().clearJoins(); return this; } catch (RuntimeException re) { throw translate(re); } }
public JDBCFetchConfiguration addJoins(Collection fields) { try { getJDBCDelegate().addJoins(fields); return this; } catch (RuntimeException re) { throw translate(re); } }
public Set getFetchInnerJoins() { try { return getJDBCDelegate().getFetchInnerJoins(); } catch (RuntimeException re) { throw translate(re); } }
public int getFetchDirection() { try { return getJDBCDelegate().getFetchDirection(); } catch (RuntimeException re) { throw translate(re); } }
public int getEagerFetchMode() { try { return getJDBCDelegate().getEagerFetchMode(); } catch (RuntimeException re) { throw translate(re); } }
int batch = getFetchConfiguration().getFetchBatchSize(); int pageSize; if (batch < 0)
public void copy(FetchConfiguration fetch) { super.copy(fetch); JDBCFetchConfiguration jf = (JDBCFetchConfiguration) fetch; setEagerFetchMode(jf.getEagerFetchMode()); setSubclassFetchMode(jf.getSubclassFetchMode()); setResultSetType(jf.getResultSetType()); setFetchDirection(jf.getFetchDirection()); setLRSSize(jf.getLRSSize()); setJoinSyntax(jf.getJoinSyntax()); addJoins(jf.getJoins()); setIgnoreDfgForFkSelect(jf.getIgnoreDfgForFkSelect()); }
getFetchConfiguration(); if (exps[0].fetchPaths != null) { fetch.addFields(Arrays.asList(exps[0].fetchPaths)); fetch.addJoins(Arrays.asList(exps[0].fetchPaths)); fetch.addFetchInnerJoins(Arrays.asList(exps[0].fetchInnerPaths)); int subclassMode = fetch.getSubclassFetchMode((ClassMapping) base); DBDictionary dict = _store.getDBDictionary(); long start = (mappings.length == 1 && dict.supportsSelectStartIndex)
rsType = ResultSet.TYPE_FORWARD_ONLY; else if (rsType == -1) rsType = fetch.getResultSetType(); if (rsConcur == -1) rsConcur = ResultSet.CONCUR_READ_ONLY; setParameters(stmnt); if (fetch != null) { if (fetch.getFetchBatchSize() > 0) stmnt.setFetchSize( _dict.getBatchFetchSize(fetch.getFetchBatchSize())); if (rsType != ResultSet.TYPE_FORWARD_ONLY && fetch.getFetchDirection() != ResultSet.FETCH_FORWARD) stmnt.setFetchDirection(fetch.getFetchDirection());
return null; if (fetch.getFetchBatchSize() < 0) return null; eagerMode = Math.min(eagerMode, fetch.getEagerFetchMode()); if (eagerMode != fetch.EAGER_PARALLEL) return null; BitSet paged = null; for (int i = 0; i < fms.length; i++) { if (fetch.requiresFetch(fms[i]) != FetchConfiguration.FETCH_LOAD) continue;
/** * Select a union of the data for the given instance from possible concrete * mappings and return the result. */ private Result getInitializeStateUnionResult(final OpenJPAStateManager sm, ClassMapping mapping, final ClassMapping[] mappings, final JDBCFetchConfiguration fetch) throws SQLException { FinderQueryImpl fq = getFinder(mapping, fetch); if (fq != null) return fq.execute(sm, this, fetch); final JDBCStoreManager store = this; final int eager = Math.min(fetch.getEagerFetchMode(), JDBCFetchConfiguration.EAGER_JOIN); Union union = _sql.newUnion(mappings.length); union.setExpectedResultCount(1, false); if (fetch.getSubclassFetchMode(mapping) != EagerFetchModes.EAGER_JOIN) union.abortUnion(); union.select(new Union.Selector() { public void select(Select sel, int i) { sel.select(mappings[i], Select.SUBS_ANY_JOINABLE, store, fetch, eager); sel.wherePrimaryKey(sm.getObjectId(), mappings[i], store); } }); Result result = union.execute(this, fetch); cacheFinder(mapping, union, fetch); return result; }