Class RowView
java.lang.Object
org.jdbi.v3.core.result.RowView
A RowView is an accessor for
ResultSet that uses
RowMapper or ColumnMapper to extract values.
It is not valid outside the scope of the method that receives it.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetColumn(int column) Returns the value of a column as the JDBC driver returns it fromResultSet.getObject(int), without a column mapper.<T> TUse a column mapper to extract a type from the current ResultSet row.Use a column mapper to extract a type from the current ResultSet row.<T> TgetColumn(int column, GenericType<T> type) Use a column mapper to extract a type from the current ResultSet row.abstract <T> TgetColumn(int column, QualifiedType<T> type) Use a qualified column mapper to extract a type from the current ResultSet row.Returns the value of a column as the JDBC driver returns it fromResultSet.getObject(String), without a column mapper.<T> TUse a column mapper to extract a type from the current ResultSet row.Use a column mapper to extract a type from the current ResultSet row.<T> TgetColumn(String column, GenericType<T> type) Use a column mapper to extract a type from the current ResultSet row.abstract <T> TgetColumn(String column, QualifiedType<T> type) Use a qualified column mapper to extract a type from the current ResultSet row.Returns the labels of the columns of the result set, in column order, asResultSetMetaData.getColumnLabel(int)returns them.<T> TUse a row mapper to extract a type from the current ResultSet row.<T> TUse a prefixed row mapper to extract a type from the current ResultSet row.abstract ObjectUse a row mapper to extract a type from the current ResultSet row.Use a prefixed row mapper to extract a type from the current ResultSet row.<T> TgetRow(GenericType<T> rowType) Use a row mapper to extract a type from the current ResultSet row.<T> TgetRow(GenericType<T> rowType, String prefix) Use a prefixed row mapper to extract a type from the current ResultSet row.<T> TMaps the current row with the given row mapper.
-
Constructor Details
-
RowView
public RowView()
-
-
Method Details
-
getRow
Use a row mapper to extract a type from the current ResultSet row.- Type Parameters:
T- the type to map- Parameters:
rowType- the Class of the type- Returns:
- the materialized T
-
getRow
Use a prefixed row mapper to extract a type from the current ResultSet row. The mapper must declare the given column name prefix, seegetRow(Type, String).- Type Parameters:
T- the type to map- Parameters:
rowType- the Class of the typeprefix- the column name prefix the mapper must declare, never null- Returns:
- the materialized T
-
getRow
Use a row mapper to extract a type from the current ResultSet row.- Type Parameters:
T- the type to map- Parameters:
rowType- the GenericType of the type- Returns:
- the materialized T
-
getRow
Use a prefixed row mapper to extract a type from the current ResultSet row. The mapper must declare the given column name prefix, seegetRow(Type, String).- Type Parameters:
T- the type to map- Parameters:
rowType- the GenericType of the typeprefix- the column name prefix the mapper must declare, never null- Returns:
- the materialized T
-
getRow
-
getRow
Use a prefixed row mapper to extract a type from the current ResultSet row.A mapper that implements
PrefixedRowMappermatches if it declares a prefix equal to the given prefix, and a mapper that declares no prefix matches the empty prefix only. This makes it possible to register multiple mappers for the same type with different column name prefixes, for example when a query joins the same table twice, and select between them per call. A mapper that does not match the given prefix is not used; the lookup fails rather than fall back to a mapper with another prefix. To look up a mapper by type alone, usegetRow(Type).- Parameters:
type- the type to mapprefix- the column name prefix the mapper must declare, never null- Returns:
- the materialized object
- Throws:
NoSuchMapperException- if no registered row mapper maps the given type with the given prefix
-
getColumnNames
Returns the labels of the columns of the result set, in column order, asResultSetMetaData.getColumnLabel(int)returns them.- Returns:
- the column labels, as an unmodifiable list
-
getRow
Maps the current row with the given row mapper. The mapper isspecializedonce per result set, keyed by mapper instance, so pass the same instance for every row.- Type Parameters:
T- the type to map- Parameters:
mapper- the row mapper- Returns:
- the materialized T
-
getColumn
Returns the value of a column as the JDBC driver returns it fromResultSet.getObject(String), without a column mapper. Use this to read a value whose type does not matter, such as a key that identifies a row.- Parameters:
column- the column name- Returns:
- the column value, or null for SQL NULL
-
getColumn
Returns the value of a column as the JDBC driver returns it fromResultSet.getObject(int), without a column mapper. Use this to read a value whose type does not matter, such as a key that identifies a row.- Parameters:
column- the column index- Returns:
- the column value, or null for SQL NULL
-
getColumn
-
getColumn
Use a column mapper to extract a type from the current ResultSet row.- Type Parameters:
T- the type to map- Parameters:
column- the column indextype- the Class of the type- Returns:
- the materialized T
-
getColumn
Use a column mapper to extract a type from the current ResultSet row.- Type Parameters:
T- the type to map- Parameters:
column- the column nametype- the GenericType of the type- Returns:
- the materialized T
-
getColumn
Use a qualified column mapper to extract a type from the current ResultSet row.- Type Parameters:
T- the type to map- Parameters:
column- the column indextype- the QualifiedType of the type- Returns:
- the materialized T
-
getColumn
Use a qualified column mapper to extract a type from the current ResultSet row.- Type Parameters:
T- the type to map- Parameters:
column- the column nametype- the QualifiedType of the type- Returns:
- the materialized T
-
getColumn
Use a column mapper to extract a type from the current ResultSet row.- Type Parameters:
T- the type to map- Parameters:
column- the column indextype- the GenericType of the type- Returns:
- the materialized T
-
getColumn
-
getColumn
-