CaseWhen

data class CaseWhen<T : Any, R : Any>(val operand: ColumnDeclaring<T>?, val whenClauses: List<Pair<ColumnDeclaring<T>, ColumnDeclaring<R>>> = emptyList(), val elseClause: ColumnDeclaring<R>? = null)(source)

Helper class used to build case-when SQL DSL. See CaseWhenExpression.

Constructors

Link copied to clipboard
constructor(operand: ColumnDeclaring<T>?, whenClauses: List<Pair<ColumnDeclaring<T>, ColumnDeclaring<R>>> = emptyList(), elseClause: ColumnDeclaring<R>? = null)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun <T : Any, R : Any> CaseWhen<T, R>.ELSE(result: ColumnDeclaring<R>): CaseWhen<T, R>
inline fun <T : Any, R : Any> CaseWhen<T, R>.ELSE(result: R, sqlType: SqlType<R> = SqlType.of() ?: error("Cannot detect the argument's SqlType, please specify manually.")): CaseWhen<T, R>

Specifies the else clause for the case-when DSL.

Link copied to clipboard

Finishes the case-when DSL and returns a CaseWhenExpression.

Link copied to clipboard
fun <T : Any, R : Any> CaseWhen<T, R>.WHEN(condition: ColumnDeclaring<T>): WhenContinuation<T, R>
inline fun <T : Any, R : Any> CaseWhen<T, R>.WHEN(condition: T, sqlType: SqlType<T> = SqlType.of() ?: error("Cannot detect the argument's SqlType, please specify manually.")): WhenContinuation<T, R>

Starts a when clause with the given condition.