@Override public final ResultSet intoResultSet() { return new MockResultSet(this); }
@Override public boolean last() throws SQLException { checkNotClosed(); return absolute(size()); }
@Override public Reader getNCharacterStream(int columnIndex) throws SQLException { return getCharacterStream(columnIndex); }
@Override public boolean isAfterLast() throws SQLException { checkNotClosed(); return (size() > 0 && index > size()); }
@Override public boolean isCurrency(int column) throws SQLException { rs.checkNotClosed(); return false; }
@Override public boolean absolute(int row) throws SQLException { if (size() > 0) { if (row > 0) { if (row <= size()) { index = row; return true; afterLast(); return false; beforeFirst(); return false; if (-row <= size()) { index = size() + 1 + row; return true; beforeFirst(); return false;
@Override public String getNString(int columnIndex) throws SQLException { return getString(columnIndex); }
@Override public InputStream getBinaryStream(int columnIndex) throws SQLException { byte[] bytes = getBytes(columnIndex); return wasNull ? null : new ByteArrayInputStream(bytes); }
private <T> T get(String columnLabel, Class<T> type) throws SQLException { checkInRange(); Converter<?, ?> converter = Converters.inverse(field(columnLabel).getConverter()); T value = Convert.convert(result.get(index - 1).get(columnLabel, converter), type); wasNull = (value == null); return value; }
private <T> T getValue(int columnIndex, Class<T> type) throws SQLException { checkInRange(); checkField(columnIndex); T value = result.get(index - 1).getValue(columnIndex - 1, type); wasNull = (value == null); return value; }
@Override public boolean previous() throws SQLException { return relative(-1); }
@Override public boolean first() throws SQLException { return absolute(1); }
@Override public boolean isFirst() throws SQLException { checkNotClosed(); return (size() > 0 && index == 1); }
@Override public int isNullable(int column) throws SQLException { rs.checkNotClosed(); // TODO: Check generated JSR-303 or JPA annotations for nullability return ResultSetMetaData.columnNullableUnknown; }
@Override public boolean absolute(int row) throws SQLException { if (size() > 0) { if (row > 0) { if (row <= size()) { index = row; return true; afterLast(); return false; beforeFirst(); return false; if (-row <= size()) { index = size() + 1 + row; return true; beforeFirst(); return false;
@Override public String getNString(String columnLabel) throws SQLException { return getString(columnLabel); }
@Override public InputStream getAsciiStream(int columnIndex) throws SQLException { byte[] bytes = getBytes(columnIndex); return wasNull ? null : new ByteArrayInputStream(bytes); }
private <T> T get(int columnIndex, Class<T> type) throws SQLException { checkInRange(); Converter<?, ?> converter = Converters.inverse(field(columnIndex).getConverter()); T value = Convert.convert(result.get(index - 1).get(columnIndex - 1, converter), type); wasNull = (value == null); return value; }
private <T> T getValue(String columnLabel, Class<T> type) throws SQLException { checkInRange(); checkField(columnLabel); T value = result.get(index - 1).getValue(columnLabel, type); wasNull = (value == null); return value; }
@Override public boolean next() throws SQLException { return relative(1); }