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 Type
    Method
    Description
    <T> Optional<T>
    map(StatementContext<T> statementContext, ResultSet resultSet, Class<T> resultSetRowType, InstanceProvider instanceProvider)
    Maps the current row of resultSet to the result class indicated by statementContext.
  • 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 of resultSet to the result class indicated by statementContext.
      Type Parameters:
      T - result instance type token
      Parameters:
      statementContext - current SQL context
      resultSet - provides raw row data to pull from*
      resultSetRowType - the type to which the ResultSet row should be marshaled
      instanceProvider - instance-creation factory, used to instantiate resultSetRowType row objects
      Returns:
      an instance of the given resultClass
      Throws:
      DatabaseException - if an error occurs during mapping