Package com.pyranid

Class DefaultResultSetMapper

    • Constructor Detail

      • 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 Detail

      • 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