Package org.dalesbred.result
Interface RowMapper<T>
- All Known Implementing Classes:
InstantiatorRowMapper
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Maps a single row of result-set into an object.
-
Method Summary
Modifier and TypeMethodDescriptiondefault @NotNull ResultSetProcessor<List<T>> list()Creates aResultSetProcessorthat applies this row-mapper to every row and results a list.Produces a single value based on current row.default @NotNull ResultSetProcessor<Optional<T>> optional()Creates aResultSetProcessorthat no rows or single row from database.default @NotNull ResultSetProcessor<T> unique()Creates aResultSetProcessorthat expects a single result row from database.
-
Method Details
-
mapRow
Produces a single value based on current row.The implementation should not call
ResultSet.next()or other methods to move the current position of theResultSet, caller is responsible for that.- Throws:
SQLException
-
list
Creates aResultSetProcessorthat applies this row-mapper to every row and results a list. -
unique
Creates aResultSetProcessorthat expects a single result row from database. -
optional
Creates aResultSetProcessorthat no rows or single row from database.
-