.
| Method from org.apache.openjpa.jdbc.kernel.SelectResultObjectProvider Detail: |
public boolean absolute(int pos) throws SQLException {
return _res.absolute(pos);
}
|
public void close() {
if (_res != null) {
_res.close();
_res = null;
}
}
|
public JDBCFetchConfiguration getFetchConfiguration() {
return _fetch;
}
|
public Result getResult() {
return _res;
}
|
public SelectExecutor getSelect() {
return _sel;
}
|
public JDBCStore getStore() {
return _store;
}
|
public void handleCheckedException(Exception e) {
if (e instanceof SQLException)
throw SQLExceptions.getStore((SQLException) e,
_store.getDBDictionary());
throw new StoreException(e);
}
|
public boolean next() throws SQLException {
return _res.next();
}
|
public void open() throws SQLException {
_res = _sel.execute(_store, _fetch);
}
|
public void reset() throws SQLException {
close();
open();
}
|
protected void setSize(int size) {
if (_size == -1)
_size = size;
}
Allow subclasses that know the size to set it; otherwise we calculate
it internally. |
public int size() throws SQLException {
if (_size == -1) {
// if res is null, don't cache size
if (_res == null)
return Integer.MAX_VALUE;
switch (_fetch.getLRSSize()) {
case LRSSizes.SIZE_UNKNOWN:
_size = Integer.MAX_VALUE;
break;
case LRSSizes.SIZE_LAST:
if (supportsRandomAccess())
_size = _res.size();
else
_size = Integer.MAX_VALUE;
break;
default: // query
_size = _sel.getCount(_store);
}
}
return _size;
}
|
public boolean supportsRandomAccess() {
if (_ra == null) {
boolean ra;
if (_res != null) {
try {
ra = _res.supportsRandomAccess();
} catch (SQLException se) {
throw SQLExceptions.getStore(se, _store.getDBDictionary());
}
} else
ra = _sel.supportsRandomAccess(_fetch.getReadLockLevel() > 0);
_ra = (ra) ? Boolean.TRUE : Boolean.FALSE;
}
return _ra.booleanValue();
}
|