open class SingleColumnRowMapper<T : Any> : RowMapper<T>
RowMapper implementation that converts a single column into a single result value per row. Expects to operate on a java.sql.ResultSet that just contains a single column.
The type of the result value for each row can be specified. The value for the single column will be extracted from the ResultSet and converted into the specified target type.
Author
Juergen Hoeller
Since
1.2
See Also
JdbcTemplate#queryForList(String, Class)JdbcTemplate#queryForObject(String, Class)
SingleColumnRowMapper()
Create a new SingleColumnRowMapper(requiredType: Class<T>)
Create a new Consider using the |
open fun mapRow(rs: ResultSet, rowNum: Int): T
Extract a value for the single column in the current row. Validates that there is only one column selected, then delegates to |
|
open static fun <T : Any> newInstance(requiredType: Class<T>): SingleColumnRowMapper<T>
Static factory method to create a new |
|
open fun setRequiredType(requiredType: Class<T>): Unit
Set the type that each result object is expected to match. If not specified, the column value will be exposed as returned by the JDBC driver. |