toListOf

abstract fun <T : Any> toListOf(kType: KType, params: Map<String, Any?> = emptyMap()): DataResult<List<T>>

Maps results to a list of objects of the given type. Requires that column names/aliases in SQL (in snake_case convention) match property names in the target class (in camelCase convention) or have a @MapKey annotation with the stored column name.


abstract fun <T : Any> toListOf(params: Map<String, Any?> = emptyMap(), mapper: DataMapper<T>): DataResult<List<T>>

Maps results to a list of objects using the provided mapper. This bypasses reflection and is the most efficient way to map results to domain objects.