Package com.pyranid
Interface ResultSetMapper
- All Known Implementing Classes:
DefaultResultSetMapper
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Contract for mapping a
ResultSet
row to a different type.- Since:
- 1.0.0
- Author:
- Mark Allen
-
Method Summary
Modifier and TypeMethodDescription<T> Optional
<T> map
(StatementContext<T> statementContext, ResultSet resultSet, Class<T> resultSetRowType, InstanceProvider instanceProvider) Maps the current row ofresultSet
to the result class indicated bystatementContext
.
-
Method Details
-
map
@Nonnull <T> Optional<T> map(@Nonnull StatementContext<T> statementContext, @Nonnull ResultSet resultSet, @Nonnull Class<T> resultSetRowType, @Nonnull InstanceProvider instanceProvider) Maps the current row ofresultSet
to the result class indicated bystatementContext
.- Type Parameters:
T
- result instance type token- Parameters:
statementContext
- current SQL contextresultSet
- provides raw row data to pull from*resultSetRowType
- the type to which theResultSet
row should be marshaledinstanceProvider
- instance-creation factory, used to instantiateresultSetRowType
row objects- Returns:
- an instance of the given
resultClass
- Throws:
DatabaseException
- if an error occurs during mapping
-