public ResultList<?> newResultList(ResultObjectProvider rop) { if (rop instanceof ListResultObjectProvider) return new SimpleResultList(rop); if (_state.fetchBatchSize < 0) return new EagerResultList(rop); if (rop.supportsRandomAccess()) return new SimpleResultList(rop); return new WindowResultList(rop); }
public ResultList<?> newResultList(ResultObjectProvider rop) { if (rop instanceof ListResultObjectProvider) return new SimpleResultList(rop); if (_state.fetchBatchSize < 0) return new EagerResultList(rop); if (rop.supportsRandomAccess()) return new SimpleResultList(rop); return new WindowResultList(rop); }
public ResultList<?> newResultList(ResultObjectProvider rop) { if (rop instanceof ListResultObjectProvider) return new SimpleResultList(rop); if (_state.fetchBatchSize < 0) return new EagerResultList(rop); if (rop.supportsRandomAccess()) return new SimpleResultList(rop); return new WindowResultList(rop); }
public ResultList<?> newResultList(ResultObjectProvider rop) { if (rop instanceof ListResultObjectProvider) return new SimpleResultList(rop); if (_state.fetchBatchSize < 0) return new EagerResultList(rop); if (rop.supportsRandomAccess()) return new SimpleResultList(rop); return new WindowResultList(rop); }
public ResultList newResultList(ResultObjectProvider rop) { if (rop instanceof ListResultObjectProvider) return new SimpleResultList(rop); if (_state.fetchBatchSize < 0) return new EagerResultList(rop); if (rop.supportsRandomAccess()) return new SimpleResultList(rop); return new WindowResultList(rop); }
/** * Return the query result for the given result object provider. */ protected Object toResult(StoreQuery q, StoreQuery.Executor ex, ResultObjectProvider rop, StoreQuery.Range range) throws Exception { // pack projections if necessary String[] aliases = ex.getProjectionAliases(q); if (!ex.isPacking(q)) { ResultPacker packer = getResultPacker(q, ex); if (packer != null || aliases.length == 1) rop = new PackingResultObjectProvider(rop, packer, aliases.length); } // if single result, extract it if (_unique == Boolean.TRUE || (aliases.length > 0 && !ex.hasGrouping(q) && ex.isAggregate(q))) return singleResult(rop, range); // now that we've executed the query, we can call isAggregate and // hasGrouping efficiently boolean detach = (_broker.getAutoDetach() & AutoDetach.DETACH_NONTXREAD) > 0 && !_broker.isActive(); boolean lrs = range.lrs && !ex.isAggregate(q) && !ex.hasGrouping(q); ResultList res = (!detach && lrs) ? _fc.newResultList(rop) : new EagerResultList(rop); _resultLists.add(decorateResultList(res)); return res; }
ResultList<?> res = new ListResultList(Collections.emptyList()); try { res = (!detach && lrs) ? _fc.newResultList(rop) : new EagerResultList(rop); res.setUserObject(new Object[]{rop,ex}); _resultLists.add(decorateResultList(res));
ResultList<?> res = new ListResultList(Collections.emptyList()); try { res = (!detach && lrs) ? _fc.newResultList(rop) : new EagerResultList(rop); res.setUserObject(new Object[]{rop,ex}); _resultLists.add(decorateResultList(res));
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); }
ResultList<?> res = new ListResultList(Collections.emptyList()); try { res = (!detach && lrs) ? _fc.newResultList(rop) : new EagerResultList(rop); res.setUserObject(new Object[]{rop,ex}); _resultLists.add(decorateResultList(res));
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); }
ResultList<?> res = new ListResultList(Collections.emptyList()); try { res = (!detach && lrs) ? _fc.newResultList(rop) : new EagerResultList(rop); res.setUserObject(new Object[]{rop,ex}); _resultLists.add(decorateResultList(res));
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 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 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); }