Revised SqlRowSet javadoc

Issue: SPR-12476
This commit is contained in:
Juergen Hoeller 2014-11-27 01:41:48 +01:00
parent 0e3b26da27
commit a6a837bc3b
1 changed files with 115 additions and 102 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -27,8 +27,8 @@ import java.util.Map;
import org.springframework.jdbc.InvalidResultSetAccessException;
/**
* Mirror interface for {@code javax.sql.RowSet}, representing
* disconnected {@code java.sql.ResultSet} data.
* Mirror interface for {@link javax.sql.RowSet}, representing
* disconnected {@link java.sql.ResultSet} data.
*
* <p>The main difference to the standard JDBC RowSet is that an SQLException
* is never thrown here. This allows a SqlRowSet to be used without having
@ -51,15 +51,15 @@ import org.springframework.jdbc.InvalidResultSetAccessException;
public interface SqlRowSet extends Serializable {
/**
* Retrieves the meta data (number, types and properties for the columns)
* of this row set.
* Retrieve the meta data, i.e. number, types and properties
* for the columns of this row set.
* @return a corresponding SqlRowSetMetaData instance
* @see java.sql.ResultSet#getMetaData()
*/
SqlRowSetMetaData getMetaData();
/**
* Maps the given column label to its column index.
* Map the given column label to its column index.
* @param columnLabel the name of the column
* @return the column index for the given column label
* @see java.sql.ResultSet#findColumn(String)
@ -70,8 +70,8 @@ public interface SqlRowSet extends Serializable {
// RowSet methods for extracting data values
/**
* Retrieves the value of the indicated column in the current row as
* an BigDecimal object.
* Retrieve the value of the indicated column in the current row
* as a BigDecimal object.
* @param columnIndex the column index
* @return an BigDecimal object representing the column value
* @see java.sql.ResultSet#getBigDecimal(int)
@ -79,8 +79,8 @@ public interface SqlRowSet extends Serializable {
BigDecimal getBigDecimal(int columnIndex) throws InvalidResultSetAccessException;
/**
* Retrieves the value of the indicated column in the current row as
* an BigDecimal object.
* Retrieve the value of the indicated column in the current row
* as a BigDecimal object.
* @param columnLabel the column label
* @return an BigDecimal object representing the column value
* @see java.sql.ResultSet#getBigDecimal(java.lang.String)
@ -88,8 +88,8 @@ public interface SqlRowSet extends Serializable {
BigDecimal getBigDecimal(String columnLabel) throws InvalidResultSetAccessException;
/**
* Retrieves the value of the indicated column in the current row as
* a boolean.
* Retrieve the value of the indicated column in the current row
* as a boolean.
* @param columnIndex the column index
* @return a boolean representing the column value
* @see java.sql.ResultSet#getBoolean(int)
@ -97,8 +97,8 @@ public interface SqlRowSet extends Serializable {
boolean getBoolean(int columnIndex) throws InvalidResultSetAccessException;
/**
* Retrieves the value of the indicated column in the current row as
* a boolean.
* Retrieve the value of the indicated column in the current row
* as a boolean.
* @param columnLabel the column label
* @return a boolean representing the column value
* @see java.sql.ResultSet#getBoolean(java.lang.String)
@ -106,8 +106,8 @@ public interface SqlRowSet extends Serializable {
boolean getBoolean(String columnLabel) throws InvalidResultSetAccessException;
/**
* Retrieves the value of the indicated column in the current row as
* a byte.
* Retrieve the value of the indicated column in the current row
* as a byte.
* @param columnIndex the column index
* @return a byte representing the column value
* @see java.sql.ResultSet#getByte(int)
@ -115,8 +115,8 @@ public interface SqlRowSet extends Serializable {
byte getByte(int columnIndex) throws InvalidResultSetAccessException;
/**
* Retrieves the value of the indicated column in the current row as
* a byte.
* Retrieve the value of the indicated column in the current row
* as a byte.
* @param columnLabel the column label
* @return a byte representing the column value
* @see java.sql.ResultSet#getByte(java.lang.String)
@ -124,8 +124,8 @@ public interface SqlRowSet extends Serializable {
byte getByte(String columnLabel) throws InvalidResultSetAccessException;
/**
* Retrieves the value of the indicated column in the current row as
* a Date object.
* Retrieve the value of the indicated column in the current row
* as a Date object.
* @param columnIndex the column index
* @param cal the Calendar to use in constructing the Date
* @return a Date object representing the column value
@ -134,8 +134,8 @@ public interface SqlRowSet extends Serializable {
Date getDate(int columnIndex, Calendar cal) throws InvalidResultSetAccessException;
/**
* Retrieves the value of the indicated column in the current row as
* a Date object.
* Retrieve the value of the indicated column in the current row
* as a Date object.
* @param columnIndex the column index
* @return a Date object representing the column value
* @see java.sql.ResultSet#getDate(int)
@ -143,8 +143,8 @@ public interface SqlRowSet extends Serializable {
Date getDate(int columnIndex) throws InvalidResultSetAccessException;
/**
* Retrieves the value of the indicated column in the current row as
* a Date object.
* Retrieve the value of the indicated column in the current row
* as a Date object.
* @param columnLabel the column label
* @param cal the Calendar to use in constructing the Date
* @return a Date object representing the column value
@ -153,8 +153,8 @@ public interface SqlRowSet extends Serializable {
Date getDate(String columnLabel, Calendar cal) throws InvalidResultSetAccessException;
/**
* Retrieves the value of the indicated column in the current row as
* a Date object.
* Retrieve the value of the indicated column in the current row
* as a Date object.
* @param columnLabel the column label
* @return a Date object representing the column value
* @see java.sql.ResultSet#getDate(java.lang.String)
@ -162,8 +162,8 @@ public interface SqlRowSet extends Serializable {
Date getDate(String columnLabel) throws InvalidResultSetAccessException;
/**
* Retrieves the value of the indicated column in the current row as
* a Double object.
* Retrieve the value of the indicated column in the current row
* as a Double object.
* @param columnIndex the column index
* @return a Double object representing the column value
* @see java.sql.ResultSet#getDouble(int)
@ -171,8 +171,8 @@ public interface SqlRowSet extends Serializable {
double getDouble(int columnIndex) throws InvalidResultSetAccessException;
/**
* Retrieves the value of the indicated column in the current row as
* a Double object.
* Retrieve the value of the indicated column in the current row
* as a Double object.
* @param columnLabel the column label
* @return a Double object representing the column value
* @see java.sql.ResultSet#getDouble(java.lang.String)
@ -180,8 +180,8 @@ public interface SqlRowSet extends Serializable {
double getDouble(String columnLabel) throws InvalidResultSetAccessException;
/**
* Retrieves the value of the indicated column in the current row as
* a float.
* Retrieve the value of the indicated column in the current row
* as a float.
* @param columnIndex the column index
* @return a float representing the column value
* @see java.sql.ResultSet#getFloat(int)
@ -189,8 +189,8 @@ public interface SqlRowSet extends Serializable {
float getFloat(int columnIndex) throws InvalidResultSetAccessException;
/**
* Retrieves the value of the indicated column in the current row as
* a float.
* Retrieve the value of the indicated column in the current row
* as a float.
* @param columnLabel the column label
* @return a float representing the column value
* @see java.sql.ResultSet#getFloat(java.lang.String)
@ -198,8 +198,8 @@ public interface SqlRowSet extends Serializable {
float getFloat(String columnLabel) throws InvalidResultSetAccessException;
/**
* Retrieves the value of the indicated column in the current row as
* an int.
* Retrieve the value of the indicated column in the current row
* as an int.
* @param columnIndex the column index
* @return an int representing the column value
* @see java.sql.ResultSet#getInt(int)
@ -207,8 +207,8 @@ public interface SqlRowSet extends Serializable {
int getInt(int columnIndex) throws InvalidResultSetAccessException;
/**
* Retrieves the value of the indicated column in the current row as
* an int.
* Retrieve the value of the indicated column in the current row
* as an int.
* @param columnLabel the column label
* @return an int representing the column value
* @see java.sql.ResultSet#getInt(java.lang.String)
@ -216,8 +216,8 @@ public interface SqlRowSet extends Serializable {
int getInt(String columnLabel) throws InvalidResultSetAccessException;
/**
* Retrieves the value of the indicated column in the current row as
* a long.
* Retrieve the value of the indicated column in the current row
* as a long.
* @param columnIndex the column index
* @return a long representing the column value
* @see java.sql.ResultSet#getLong(int)
@ -225,8 +225,8 @@ public interface SqlRowSet extends Serializable {
long getLong(int columnIndex) throws InvalidResultSetAccessException;
/**
* Retrieves the value of the indicated column in the current row as
* a long.
* Retrieve the value of the indicated column in the current row
* as a long.
* @param columnLabel the column label
* @return a long representing the column value
* @see java.sql.ResultSet#getLong(java.lang.String)
@ -234,8 +234,8 @@ public interface SqlRowSet extends Serializable {
long getLong(String columnLabel) throws InvalidResultSetAccessException;
/**
* Retrieves the value of the indicated column in the current row as
* an Object.
* Retrieve the value of the indicated column in the current row
* as an Object.
* @param columnIndex the column index
* @param map a Map object containing the mapping from SQL types to Java types
* @return a Object representing the column value
@ -244,8 +244,8 @@ public interface SqlRowSet extends Serializable {
Object getObject(int columnIndex, Map<String, Class<?>> map) throws InvalidResultSetAccessException;
/**
* Retrieves the value of the indicated column in the current row as
* an Object.
* Retrieve the value of the indicated column in the current row
* as an Object.
* @param columnIndex the column index
* @return a Object representing the column value
* @see java.sql.ResultSet#getObject(int)
@ -253,8 +253,8 @@ public interface SqlRowSet extends Serializable {
Object getObject(int columnIndex) throws InvalidResultSetAccessException;
/**
* Retrieves the value of the indicated column in the current row as
* an Object.
* Retrieve the value of the indicated column in the current row
* as an Object.
* @param columnLabel the column label
* @param map a Map object containing the mapping from SQL types to Java types
* @return a Object representing the column value
@ -263,8 +263,8 @@ public interface SqlRowSet extends Serializable {
Object getObject(String columnLabel, Map<String, Class<?>> map) throws InvalidResultSetAccessException;
/**
* Retrieves the value of the indicated column in the current row as
* an Object.
* Retrieve the value of the indicated column in the current row
* as an Object.
* @param columnLabel the column label
* @return a Object representing the column value
* @see java.sql.ResultSet#getObject(java.lang.String)
@ -272,8 +272,8 @@ public interface SqlRowSet extends Serializable {
Object getObject(String columnLabel) throws InvalidResultSetAccessException;
/**
* Retrieves the value of the indicated column in the current row as
* a short.
* Retrieve the value of the indicated column in the current row
* as a short.
* @param columnIndex the column index
* @return a short representing the column value
* @see java.sql.ResultSet#getShort(int)
@ -281,8 +281,8 @@ public interface SqlRowSet extends Serializable {
short getShort(int columnIndex) throws InvalidResultSetAccessException;
/**
* Retrieves the value of the indicated column in the current row as
* a short.
* Retrieve the value of the indicated column in the current row
* as a short.
* @param columnLabel the column label
* @return a short representing the column value
* @see java.sql.ResultSet#getShort(java.lang.String)
@ -290,8 +290,8 @@ public interface SqlRowSet extends Serializable {
short getShort(String columnLabel) throws InvalidResultSetAccessException;
/**
* Retrieves the value of the indicated column in the current row as
* a String.
* Retrieve the value of the indicated column in the current row
* as a String.
* @param columnIndex the column index
* @return a String representing the column value
* @see java.sql.ResultSet#getString(int)
@ -299,8 +299,8 @@ public interface SqlRowSet extends Serializable {
String getString(int columnIndex) throws InvalidResultSetAccessException;
/**
* Retrieves the value of the indicated column in the current row as
* a String.
* Retrieve the value of the indicated column in the current row
* as a String.
* @param columnLabel the column label
* @return a String representing the column value
* @see java.sql.ResultSet#getString(java.lang.String)
@ -308,8 +308,8 @@ public interface SqlRowSet extends Serializable {
String getString(String columnLabel) throws InvalidResultSetAccessException;
/**
* Retrieves the value of the indicated column in the current row as
* a Time object.
* Retrieve the value of the indicated column in the current row
* as a Time object.
* @param columnIndex the column index
* @param cal the Calendar to use in constructing the Date
* @return a Time object representing the column value
@ -318,8 +318,8 @@ public interface SqlRowSet extends Serializable {
Time getTime(int columnIndex, Calendar cal) throws InvalidResultSetAccessException;
/**
* Retrieves the value of the indicated column in the current row as
* a Time object.
* Retrieve the value of the indicated column in the current row
* as a Time object.
* @param columnIndex the column index
* @return a Time object representing the column value
* @see java.sql.ResultSet#getTime(int)
@ -327,8 +327,8 @@ public interface SqlRowSet extends Serializable {
Time getTime(int columnIndex) throws InvalidResultSetAccessException;
/**
* Retrieves the value of the indicated column in the current row as
* a Time object.
* Retrieve the value of the indicated column in the current row
* as a Time object.
* @param columnLabel the column label
* @param cal the Calendar to use in constructing the Date
* @return a Time object representing the column value
@ -337,8 +337,8 @@ public interface SqlRowSet extends Serializable {
Time getTime(String columnLabel, Calendar cal) throws InvalidResultSetAccessException;
/**
* Retrieves the value of the indicated column in the current row as
* a Time object.
* Retrieve the value of the indicated column in the current row
* as a Time object.
* @param columnLabel the column label
* @return a Time object representing the column value
* @see java.sql.ResultSet#getTime(java.lang.String)
@ -346,8 +346,8 @@ public interface SqlRowSet extends Serializable {
Time getTime(String columnLabel) throws InvalidResultSetAccessException;
/**
* Retrieves the value of the indicated column in the current row as
* a Timestamp object.
* Retrieve the value of the indicated column in the current row
* as a Timestamp object.
* @param columnIndex the column index
* @param cal the Calendar to use in constructing the Date
* @return a Timestamp object representing the column value
@ -356,8 +356,8 @@ public interface SqlRowSet extends Serializable {
Timestamp getTimestamp(int columnIndex, Calendar cal) throws InvalidResultSetAccessException;
/**
* Retrieves the value of the indicated column in the current row as
* a Timestamp object.
* Retrieve the value of the indicated column in the current row
* as a Timestamp object.
* @param columnIndex the column index
* @return a Timestamp object representing the column value
* @see java.sql.ResultSet#getTimestamp(int)
@ -365,8 +365,8 @@ public interface SqlRowSet extends Serializable {
Timestamp getTimestamp(int columnIndex) throws InvalidResultSetAccessException;
/**
* Retrieves the value of the indicated column in the current row as
* a Timestamp object.
* Retrieve the value of the indicated column in the current row
* as a Timestamp object.
* @param columnLabel the column label
* @param cal the Calendar to use in constructing the Date
* @return a Timestamp object representing the column value
@ -375,8 +375,8 @@ public interface SqlRowSet extends Serializable {
Timestamp getTimestamp(String columnLabel, Calendar cal) throws InvalidResultSetAccessException;
/**
* Retrieves the value of the indicated column in the current row as
* a Timestamp object.
* Retrieve the value of the indicated column in the current row
* as a Timestamp object.
* @param columnLabel the column label
* @return a Timestamp object representing the column value
* @see java.sql.ResultSet#getTimestamp(java.lang.String)
@ -387,101 +387,114 @@ public interface SqlRowSet extends Serializable {
// RowSet navigation methods
/**
* Moves the cursor to the given row number in the RowSet, just after the last row.
* Move the cursor to the given row number in the row set,
* just after the last row.
* @param row the number of the row where the cursor should move
* @return true if the cursor is on the RowSet, false otherwise
* @return {@code true} if the cursor is on the row set,
* {@code false} otherwise
* @see java.sql.ResultSet#absolute(int)
*/
boolean absolute(int row) throws InvalidResultSetAccessException;
/**
* Moves the cursor to the end of this RowSet.
* Move the cursor to the end of this row set.
* @see java.sql.ResultSet#afterLast()
*/
void afterLast() throws InvalidResultSetAccessException;
/**
* Moves the cursor to the front of this RowSet, just before the first row.
* Move the cursor to the front of this row set,
* just before the first row.
* @see java.sql.ResultSet#beforeFirst()
*/
void beforeFirst() throws InvalidResultSetAccessException;
/**
* Moves the cursor to the first row of this RowSet.
* @return true if the cursor is on a valid row, false otherwise
* Move the cursor to the first row of this row set.
* @return {@code true} if the cursor is on a valid row,
* {@code false} otherwise
* @see java.sql.ResultSet#first()
*/
boolean first() throws InvalidResultSetAccessException;
/**
* Retrieves the current row number.
* Retrieve the current row number.
* @return the current row number
* @see java.sql.ResultSet#getRow()
*/
int getRow() throws InvalidResultSetAccessException;
/**
* Retrieves whether the cursor is after the last row of this RowSet.
* @return true if the cursor is after the last row, false otherwise
* Retrieve whether the cursor is after the last row of this row set.
* @return {@code true} if the cursor is after the last row,
* {@code false} otherwise
* @see java.sql.ResultSet#isAfterLast()
*/
boolean isAfterLast() throws InvalidResultSetAccessException;
/**
* Retrieves whether the cursor is after the first row of this RowSet.
* @return true if the cursor is after the first row, false otherwise
* Retrieve whether the cursor is before the first row of this row set.
* @return {@code true} if the cursor is before the first row,
* {@code false} otherwise
* @see java.sql.ResultSet#isBeforeFirst()
*/
boolean isBeforeFirst() throws InvalidResultSetAccessException;
/**
* Retrieves whether the cursor is on the first row of this RowSet.
* @return true if the cursor is after the first row, false otherwise
* Retrieve whether the cursor is on the first row of this row set.
* @return {@code true} if the cursor is after the first row,
* {@code false} otherwise
* @see java.sql.ResultSet#isFirst()
*/
boolean isFirst() throws InvalidResultSetAccessException;
/**
* Retrieves whether the cursor is on the last row of this RowSet.
* @return true if the cursor is after the last row, false otherwise
* Retrieve whether the cursor is on the last row of this row set.
* @return {@code true} if the cursor is after the last row,
* {@code false} otherwise
* @see java.sql.ResultSet#isLast()
*/
boolean isLast() throws InvalidResultSetAccessException;
/**
* Moves the cursor to the last row of this RowSet.
* @return true if the cursor is on a valid row, false otherwise
* Move the cursor to the last row of this row set.
* @return {@code true} if the cursor is on a valid row,
* {@code false} otherwise
* @see java.sql.ResultSet#last()
*/
boolean last() throws InvalidResultSetAccessException;
/**
* Moves the cursor to the next row.
* @return true if the new row is valid, false if there are no more rows
* Move the cursor to the next row.
* @return {@code true} if the new row is valid,
* {@code false} if there are no more rows
* @see java.sql.ResultSet#next()
*/
boolean next() throws InvalidResultSetAccessException;
/**
* Moves the cursor to the previous row.
* @return true if the new row is valid, false if it is off the RowSet
* Move the cursor to the previous row.
* @return {@code true} if the new row is valid,
* {@code false} if it is off the row set
* @see java.sql.ResultSet#previous()
*/
boolean previous() throws InvalidResultSetAccessException;
/**
* Moves the cursor a relative number f rows, either positive or negative.
* @return true if the cursor is on a row, false otherwise
* Move the cursor a relative number of rows,
* either positive or negative.
* @return {@code true} if the cursor is on a row,
* {@code false} otherwise
* @see java.sql.ResultSet#relative(int)
*/
boolean relative(int rows) throws InvalidResultSetAccessException;
/**
* Reports whether the last column read had a value of SQL {@code NULL}.
* Note that you must first call one of the getter methods and then call
* the {@code wasNull} method.
* @return true if the most recent coumn retrieved was SQL {@code NULL},
* false otherwise
* Report whether the last column read had a value of SQL {@code NULL}.
* <p>Note that you must first call one of the getter methods
* and then call the {@code wasNull()} method.
* @return {@code true} if the most recent coumn retrieved was
* SQL {@code NULL}, {@code false} otherwise
* @see java.sql.ResultSet#wasNull()
*/
boolean wasNull() throws InvalidResultSetAccessException;