protected FetchConfigurationImpl newInstance(ConfigurationState state) { JDBCConfigurationState jstate = (state == null) ? null : _state; return new JDBCFetchConfigurationImpl(state, jstate); }
public JDBCFetchConfiguration addFetchInnerJoins(Collection<String> joins) { if (joins == null || joins.isEmpty()) return this; for (Iterator<String> itr = joins.iterator(); itr.hasNext();) addFetchInnerJoin((String) itr.next()); return this; } }
public JDBCFetchConfiguration addJoins(Collection<String> joins) { if (joins == null || joins.isEmpty()) return this; for (Iterator<String> itr = joins.iterator(); itr.hasNext();) addJoin(itr.next()); return this; }
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()); }
public void setContext(StoreContext ctx) { super.setContext(ctx); JDBCConfiguration conf = getJDBCConfiguration(); if (conf == null) return; setEagerFetchMode(conf.getEagerFetchModeConstant()); setSubclassFetchMode(conf.getSubclassFetchModeConstant()); setResultSetType(conf.getResultSetTypeConstant()); setFetchDirection(conf.getFetchDirectionConstant()); setLRSSize(conf.getLRSSizeConstant()); setJoinSyntax(conf.getDBDictionaryInstance().joinSyntax); }
public JDBCFetchConfiguration setEagerFetchMode(int mode) { if (mode == DEFAULT) { JDBCConfiguration conf = getJDBCConfiguration(); if (conf != null) mode = conf.getEagerFetchModeConstant(); } if (mode != DEFAULT) _state.eagerMode = mode; return this; }
/** * Access JDBC configuration information. May return null if not a * JDBC back-end (possible to get a JDBCFetchConfiguration on non-JDBC * back end in remote client). */ private JDBCConfiguration getJDBCConfiguration() { StoreContext ctx = getContext(); if (ctx == null) return null; OpenJPAConfiguration conf = ctx.getConfiguration(); if (!(conf instanceof JDBCConfiguration)) return null; return (JDBCConfiguration) conf; }
public ResultList<?> newResultList(ResultObjectProvider rop) { // if built around a list, just use a simple wrapper if (rop instanceof ListResultObjectProvider) return new SimpleResultList(rop); // if built around a paging list, use a window provider with the // same window size if (rop instanceof PagingResultObjectProvider) return new WindowResultList(rop, ((PagingResultObjectProvider) rop).getPageSize()); // if fetch size < 0 just read in all results immediately if (getFetchBatchSize() < 0) return new EagerResultList(rop); // if foward only or forward direction use a forward window if (_state.type == ResultSet.TYPE_FORWARD_ONLY || _state.direction == ResultSet.FETCH_FORWARD || !rop.supportsRandomAccess()) { if (getFetchBatchSize() > 0 && getFetchBatchSize() <= 50) return new WindowResultList(rop, getFetchBatchSize()); return new WindowResultList(rop, 50); } // if skipping around use a caching random access list if (_state.direction == ResultSet.FETCH_UNKNOWN) return new SoftRandomAccessResultList(rop); // scrolling reverse... just use non-caching simple result list return new SimpleResultList(rop); }
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()); }
public void setContext(StoreContext ctx) { super.setContext(ctx); JDBCConfiguration conf = getJDBCConfiguration(); if (conf == null) return; setEagerFetchMode(conf.getEagerFetchModeConstant()); setSubclassFetchMode(conf.getSubclassFetchModeConstant()); setResultSetType(conf.getResultSetTypeConstant()); setFetchDirection(conf.getFetchDirectionConstant()); setLRSSize(conf.getLRSSizeConstant()); setJoinSyntax(conf.getDBDictionaryInstance().joinSyntax); }
public JDBCFetchConfiguration setFetchDirection(int direction) { if (direction == DEFAULT) { JDBCConfiguration conf = getJDBCConfiguration(); if (conf != null) _state.direction = conf.getFetchDirectionConstant(); } else _state.direction = direction; return this; }
/** * Access JDBC configuration information. May return null if not a * JDBC back-end (possible to get a JDBCFetchConfiguration on non-JDBC * back end in remote client). */ private JDBCConfiguration getJDBCConfiguration() { StoreContext ctx = getContext(); if (ctx == null) return null; OpenJPAConfiguration conf = ctx.getConfiguration(); if (!(conf instanceof JDBCConfiguration)) return null; return (JDBCConfiguration) conf; }
public ResultList<?> newResultList(ResultObjectProvider rop) { // if built around a list, just use a simple wrapper if (rop instanceof ListResultObjectProvider) return new SimpleResultList(rop); // if built around a paging list, use a window provider with the // same window size if (rop instanceof PagingResultObjectProvider) return new WindowResultList(rop, ((PagingResultObjectProvider) rop).getPageSize()); // if fetch size < 0 just read in all results immediately if (getFetchBatchSize() < 0) return new EagerResultList(rop); // if foward only or forward direction use a forward window if (_state.type == ResultSet.TYPE_FORWARD_ONLY || _state.direction == ResultSet.FETCH_FORWARD || !rop.supportsRandomAccess()) { if (getFetchBatchSize() > 0 && getFetchBatchSize() <= 50) return new WindowResultList(rop, getFetchBatchSize()); return new WindowResultList(rop, 50); } // if skipping around use a caching random access list if (_state.direction == ResultSet.FETCH_UNKNOWN) return new SoftRandomAccessResultList(rop); // scrolling reverse... just use non-caching simple result list return new SimpleResultList(rop); }
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()); }
public void setContext(StoreContext ctx) { super.setContext(ctx); JDBCConfiguration conf = getJDBCConfiguration(); if (conf == null) return; setEagerFetchMode(conf.getEagerFetchModeConstant()); setSubclassFetchMode(conf.getSubclassFetchModeConstant()); setResultSetType(conf.getResultSetTypeConstant()); setFetchDirection(conf.getFetchDirectionConstant()); setLRSSize(conf.getLRSSizeConstant()); setJoinSyntax(conf.getDBDictionaryInstance().joinSyntax); }
public JDBCFetchConfiguration setJoinSyntax(int syntax) { if (syntax == DEFAULT) { JDBCConfiguration conf = getJDBCConfiguration(); if (conf != null) _state.syntax = conf.getDBDictionaryInstance().joinSyntax; } else _state.syntax = syntax; return this; }
public FetchConfiguration newFetchConfiguration() { return new JDBCFetchConfigurationImpl(); }