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 int size() { assertOpen(); if (_size != -1) return _size; try { _size = _rop.size(); return _size; } catch (RuntimeException re) { close(); throw re; } catch (Exception e) { close(); _rop.handleCheckedException(e); return -1; } }
public Object writeReplace() throws ObjectStreamException { if (_closed) return this; // load results into list List list = new ArrayList(); for (Iterator itr = iterator(); itr.hasNext();) list.add(itr.next()); return list; } }
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 int size() { assertOpen(); if (_size != -1) return _size; try { _size = _rop.size(); return _size; } catch (RuntimeException re) { close(); throw re; } catch (Exception e) { close(); _rop.handleCheckedException(e); return -1; } }
public Object writeReplace() throws ObjectStreamException { if (_closed) return this; // load results into list List list = new ArrayList(); for (Iterator itr = iterator(); itr.hasNext();) list.add(itr.next()); return list; } }
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 int size() { assertOpen(); if (_size != -1) return _size; try { _size = _rop.size(); return _size; } catch (RuntimeException re) { close(); throw re; } catch (Exception e) { close(); _rop.handleCheckedException(e); return -1; } }
public Object writeReplace() throws ObjectStreamException { if (_closed) return this; // load results into list List list = new ArrayList(); for (Iterator itr = iterator(); itr.hasNext();) list.add(itr.next()); return list; } }
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 int size() { assertOpen(); if (_size != -1) return _size; try { _size = _rop.size(); return _size; } catch (RuntimeException re) { close(); throw re; } catch (Exception e) { close(); _rop.handleCheckedException(e); return -1; } }
public Object writeReplace() throws ObjectStreamException { if (_closed) return this; // load results into list List list = new ArrayList(); for (Iterator itr = iterator(); itr.hasNext();) list.add(itr.next()); return list; } }
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 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); }