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 aResultSetProcessor
that 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 aResultSetProcessor
that no rows or single row from database.default @NotNull ResultSetProcessor<T>
unique()
Creates aResultSetProcessor
that 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 aResultSetProcessor
that applies this row-mapper to every row and results a list. -
unique
Creates aResultSetProcessor
that expects a single result row from database. -
optional
Creates aResultSetProcessor
that no rows or single row from database.
-