Interface JdbcClient.Rows<T>
- Type Parameters:
T- mapped type
- Enclosing interface:
JdbcClient
public static interface JdbcClient.Rows<T>
Materialized result terminals for a mapped query or generated key result.
The stage accepts exactly one terminal invocation and is not safe for concurrent use. An exception from an application mapper is propagated unchanged.
-
Method Summary
-
Method Details
-
one
T one()Returns exactly one row.- Returns:
- mapped row
- Throws:
NoResultException- if no row is returnedNonUniqueResultException- if more than one row is returnedDataException- if JDBC execution or provider mapping failsIllegalStateException- if a terminal operation has started
-
optional
Returns zero or one row.For a scalar stage created by
JdbcClient.Statement.map(Class), an empty result represents either no row or exactly one row whose first column is SQLNULL. For a stage created byJdbcClient.Statement.map(RowMapper), an empty result represents no row; the mapper may return anOptionalvalue to represent column nullability separately.- Returns:
- empty if no row is returned or, for scalar mapping selected
by
JdbcClient.Statement.map(Class), if one row contains SQLNULLin column one; otherwise the mapped row - Throws:
NonUniqueResultException- if more than one row is returnedDataException- if JDBC execution or provider mapping failsIllegalStateException- if a terminal operation has started
-
list
Returns all rows in JDBC encounter order.- Returns:
- materialized rows
- Throws:
DataException- if JDBC execution or provider mapping failsIllegalStateException- if a terminal operation has started
-