public interface Row
Column names used as input to getter methods are case insensitive. When a get method is called with a column name and several columns have the same name, then the value of the first matching column will be returned. The column name option is designed to be used when column names are used in the SQL query that generated the result set. Columns that are not explicitly named in the query should be referenced through column indexes.
For maximum portability, result columns within each Row
should be read in left-to-right order, and each column should be read only once.
get(String)
and get(int)
without specifying a target type returns a suitable value representation. The R2DBC specification contains a mapping table that shows default
mappings between database
types and Java types.
Specifying a target type, the R2DBC driver attempts to convert the value to the target type.
A row is invalidated after consumption in the mapping function
.
The number, type and characteristics of columns are described through RowMetadata
Modifier and Type | Method and Description |
---|---|
default Object |
get(int index)
Returns the value for a column in this row using the default type mapping.
|
<T> T |
get(int index,
Class<T> type)
Returns the value for a column in this row.
|
default Object |
get(String name)
Returns the value for a column in this row using the default type mapping.
|
<T> T |
get(String name,
Class<T> type)
Returns the value for a column in this row.
|
@Nullable default Object get(int index)
get(int, Class)
passing Object
as the type
to allow the implementation to make the loosest possible match.index
- the index of the column starting at 0
null
.@Nullable <T> T get(int index, Class<T> type)
Object
to allow the implementation to make the loosest possible match.T
- the type of the item being returned.index
- the index of the column starting at 0
type
- the type of item to return. This type must be assignable to, and allows for variance.null
.IllegalArgumentException
- if type
is null
@Nullable default Object get(String name)
get(String, Class)
passing Object
as the type in
order to allow the implementation to make the loosest possible match.name
- the name of the columnnull
.IllegalArgumentException
- if name
is null
@Nullable <T> T get(String name, Class<T> type)
Object
to allow the implementation to make the loosest possible match.T
- the type of the item being returned.name
- the name of the columntype
- the type of item to return. This type must be assignable to, and allows for variance.null
.IllegalArgumentException
- if name
or type
is null
Copyright © 2021. All rights reserved.