# CaseWhen

class CaseWhen<T>(val value: Expression<*>?)

Represents an SQL function that allows the comparison of value to chained conditional clauses.

If value is not provided, each chained conditional will be evaluated independently.

## Constructors

CaseWhen
Link copied to clipboard
constructor(value: Expression<*>?)

## Properties

cases
Link copied to clipboard
val cases: MutableList<Pair<Expression<Boolean>, Expression<out T>>>

The boolean conditions to check and their resulting expressions if the condition is met.

value
Link copied to clipboard
val value: Expression<*>?

The value that is compared against every conditional expression.

## Functions

Else
Link copied to clipboard
fun Else(e: Expression<T>): ExpressionWithColumnType<T>

Adds an expression that will be used as the function result if all cases evaluate to `false`.

When
Link copied to clipboard
fun When(cond: Expression<Boolean>, result: Expression<T>): CaseWhen<T>

Adds a conditional expression with a result if the expression evaluates to `true`.