db9010 / com.jovial.db9010 / ResultsHolder

ResultsHolder

abstract class ResultsHolder

Abstract superclass for objects that hold a ResultSet: SelectQuery and InsertStatement.Result. This class maintains a map that is used to look up a desired Column, and find it in a ResultSet.

Properties

columnIndex

val columnIndex: Map<Column<*>, Int>

columns

val columns: List<Column<*>>

Functions

get

Get the value from column c, as the type determined by Column.adapter]

operator fun <T> get(c: Column<out T>): T

getFromLambda

Get the vaule from column c, as returned by body, which takes a ResultSet and a column index.

fun <T> getFromLambda(c: Column<out T>, body: (ResultSet, Int) -> T): T

getJson

Get a JSON-friendly map of column names to column values. The values are obtained from ResultSet.getObject. See also Types.sqlObject.

fun getJson(): Map<String, Any?>

Inheritors

SelectQuery

An SQL select query. See Database.select.

class SelectQuery : ResultsHolder, ParameterSetter