RowMappers

internal class RowMappers(typeRegistry: TypeRegistry)

Factory providing various RowMapper implementations for ResultSet conversion.

Creates ResultSetValueExtractor internally from the provided TypeRegistry.

Parameters

typeRegistry

Type registry for value extraction

Constructors

Link copied to clipboard
constructor(typeRegistry: TypeRegistry)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun ColumnNameMapper(): RowMapper<Map<String, Any?>>

Mapper mapping to Map<String, Any?>. Uses only column name as key. Ideal for reports and simple queries.

Link copied to clipboard
fun <T : Any> DataObjectMapper(kClass: KClass<T>): RowMapper<T>

Generic mapper that converts a row to a data class object. First maps the row to Map using ColumnNameMapper, then uses reflection (via toDataObject) to create a class instance.

Link copied to clipboard
fun SingleValueMapper(kType: KType): RowMapper<Any?>

Mapper mapping result from a single column to its value. Used for queries like SELECT COUNT(*), SELECT id FROM ... etc.