2014-04-22 14:40:18 -04:00
|
|
|
package com.moparisthebest.jdbc;
|
|
|
|
|
|
|
|
import java.sql.SQLException;
|
|
|
|
|
|
|
|
/**
|
2017-05-18 14:26:23 -04:00
|
|
|
* Created by mopar on 5/18/17.
|
2014-04-22 14:40:18 -04:00
|
|
|
*/
|
2017-05-18 14:26:23 -04:00
|
|
|
public interface RowMapper<K,T> {
|
|
|
|
/**
|
|
|
|
* Map a ResultSet row to the return type class
|
|
|
|
* @return An instance of class, if _mapKeyType is not null and _columnCount is 2, return only index 2
|
|
|
|
*/
|
|
|
|
T mapRowToReturnType() throws SQLException;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* key for map
|
|
|
|
* @return index number 1, with type of _mapKeyType
|
|
|
|
* @throws MapperException if _mapKeyType is null
|
|
|
|
*/
|
|
|
|
K getMapKey() throws SQLException;
|
2014-04-22 14:40:18 -04:00
|
|
|
}
|