Package com.pyranid

Class DefaultResultSetMapper

java.lang.Object
com.pyranid.DefaultResultSetMapper
All Implemented Interfaces:
ResultSetMapper

@ThreadSafe public class DefaultResultSetMapper extends Object implements ResultSetMapper
Basic implementation of ResultSetMapper.
Since:
1.0.0
Author:
Mark Allen
  • Constructor Details

    • DefaultResultSetMapper

      Creates a ResultSetMapper with default configuration.
    • DefaultResultSetMapper

      public DefaultResultSetMapper(@Nullable DatabaseType databaseType)
      Creates a ResultSetMapper for the given databaseType.
      Parameters:
      databaseType - the type of database we're working with
    • DefaultResultSetMapper

      public DefaultResultSetMapper(@Nullable ZoneId timeZone)
      Creates a ResultSetMapper for the given timeZone.
      Parameters:
      timeZone - the timezone to use when working with Timestamp and similar values
    • DefaultResultSetMapper

      public DefaultResultSetMapper(@Nullable DatabaseType databaseType, @Nullable ZoneId timeZone)
      Creates a ResultSetMapper for the given databaseType and timeZone.
      Parameters:
      databaseType - the type of database we're working with
      timeZone - the timezone to use when working with Timestamp and similar values
      Since:
      1.0.15
  • Method Details

    • map

      @Nonnull public <T> Optional<T> map(@Nonnull StatementContext<T> statementContext, @Nonnull ResultSet resultSet, @Nonnull Class<T> resultSetRowType, @Nonnull InstanceProvider instanceProvider)
      Description copied from interface: ResultSetMapper
      Maps the current row of resultSet to the result class indicated by statementContext.
      Specified by:
      map in interface ResultSetMapper
      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