Package com.pyranid

Class DefaultResultSetMapper

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

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

    • DefaultResultSetMapper

      public DefaultResultSetMapper(DatabaseType databaseType, InstanceProvider instanceProvider)
      Creates a ResultSetMapper for the given databaseType and instanceProvider.
      Parameters:
      databaseType - the type of database we're working with
      instanceProvider - instance-creation factory, used to instantiate resultset row objects as needed
    • DefaultResultSetMapper

      public DefaultResultSetMapper(DatabaseType databaseType, InstanceProvider instanceProvider, ZoneId timeZone)
      Creates a ResultSetMapper for the given databaseType and instanceProvider.
      Parameters:
      databaseType - the type of database we're working with
      instanceProvider - instance-creation factory, used to instantiate resultset row objects as needed
      timeZone - the timezone to use when working with Timestamp and similar values
      Since:
      1.0.15
  • Method Details

    • map

      public <T> T map(ResultSet resultSet, Class<T> resultClass)
      Description copied from interface: ResultSetMapper
      Maps the current row of resultSet into an instance of resultClass.
      Specified by:
      map in interface ResultSetMapper
      Type Parameters:
      T - result instance type token
      Parameters:
      resultSet - provides raw row data to pull from
      resultClass - the type of instance to map to
      Returns:
      an instance of the given resultClass