AggregateExpression

data class AggregateExpression<T : Any>(val type: AggregateType, val argument: ScalarExpression<*>?, val isDistinct: Boolean = false, val sqlType: SqlType<T>, val isLeafNode: Boolean = false, val extraProperties: Map<String, Any> = emptyMap()) : ScalarExpression<T> (source)

Aggregate expression.

Constructors

Link copied to clipboard
constructor(type: AggregateType, argument: ScalarExpression<*>?, isDistinct: Boolean = false, sqlType: SqlType<T>, isLeafNode: Boolean = false, extraProperties: Map<String, Any> = emptyMap())

Properties

Link copied to clipboard

the aggregated column, might be a ColumnExpression or other scalar expression types.

Link copied to clipboard
open override val extraProperties: Map<String, Any>

Extra properties of this expression, maybe useful in SqlFormatter to generate some special SQLs.

Link copied to clipboard
val isDistinct: Boolean = false

mark if this aggregation is distinct.

Link copied to clipboard
open override val isLeafNode: Boolean = false

Check if this expression is a leaf node in expression trees.

Link copied to clipboard
open override val sqlType: SqlType<T>

The SqlType of this column or expression.

Link copied to clipboard

the expression's type.

Functions

Link copied to clipboard
open override fun aliased(label: String?): ColumnDeclaringExpression<T>

Wrap this instance as a ColumnDeclaringExpression.

Link copied to clipboard

And operator, translated to the and keyword in SQL.

Link copied to clipboard

Order this column or expression in ascending order.

Link copied to clipboard
open override fun asExpression(): ScalarExpression<T>

Convert this instance to a ScalarExpression.

Link copied to clipboard

Between operator, translated to between .. and .. in SQL.

Link copied to clipboard

Cast the current column or expression to the given SqlType.

Link copied to clipboard

Order this column or expression in descending order, corresponding to the desc keyword in SQL.

Link copied to clipboard
infix operator fun <T : Number> ColumnDeclaring<T>.div(value: T): BinaryExpression<T>
infix operator fun <T : Number> ColumnDeclaring<T>.div(expr: ColumnDeclaring<T>): BinaryExpression<T>

Divide operator, translated to / in SQL.

Link copied to clipboard
infix fun <T : Any> ColumnDeclaring<T>.eq(value: T): BinaryExpression<Boolean>

Equal operator, translated to = in SQL.

Link copied to clipboard

Greater operator, translated to > in SQL.

Link copied to clipboard

Greater-eq operator, translated to >= in SQL.

Link copied to clipboard

Greater operator, translated to > in SQL.

Link copied to clipboard

Greater-eq operator, translated to >= in SQL.

Link copied to clipboard
fun <T : Any> ColumnDeclaring<T>.inList(vararg list: T): InListExpression

In-list operator, translated to the in keyword in SQL.

Link copied to clipboard

Check if the current column or expression is not null, translated to is not null in SQL.

Link copied to clipboard

Check if the current column or expression is null, translated to is null in SQL.

Link copied to clipboard

Less operator, translated to < in SQL.

Link copied to clipboard

Less-eq operator, translated to <= in SQL.

Link copied to clipboard

Like operator, translated to the like keyword in SQL.

Link copied to clipboard

Less operator, translated to < in SQL.

Link copied to clipboard

Less-eq operator, translated to <= in SQL.

Link copied to clipboard
infix operator fun <T : Number> ColumnDeclaring<T>.minus(value: T): BinaryExpression<T>
infix operator fun <T : Number> ColumnDeclaring<T>.minus(expr: ColumnDeclaring<T>): BinaryExpression<T>

Minus operator, translated to - in SQL.

Link copied to clipboard
infix fun <T : Any> ColumnDeclaring<T>.neq(value: T): BinaryExpression<Boolean>

Not-equal operator, translated to <> in SQL.

Link copied to clipboard

Negative operator, translated to the not keyword in SQL.

Link copied to clipboard

Not-between operator, translated to not between .. and .. in SQL.

Link copied to clipboard

Not-equal operator, translated to <> in SQL.

Link copied to clipboard

Not-in-list operator, translated to the not in keyword in SQL.

Link copied to clipboard

Not like operator, translated to the not like keyword in SQL.

Link copied to clipboard

Or operator, translated to the or keyword in SQL.

Link copied to clipboard

Use this aggregate function as a window function and specify its window specification.

Link copied to clipboard
infix operator fun <T : Number> ColumnDeclaring<T>.plus(value: T): BinaryExpression<T>
infix operator fun <T : Number> ColumnDeclaring<T>.plus(expr: ColumnDeclaring<T>): BinaryExpression<T>

Plus operator, translated to + in SQL.

Link copied to clipboard
infix operator fun <T : Number> ColumnDeclaring<T>.rem(value: T): BinaryExpression<T>
infix operator fun <T : Number> ColumnDeclaring<T>.rem(expr: ColumnDeclaring<T>): BinaryExpression<T>

Mod operator, translated to % in SQL.

Link copied to clipboard
infix operator fun <T : Number> ColumnDeclaring<T>.times(value: T): BinaryExpression<T>
infix operator fun <T : Number> ColumnDeclaring<T>.times(expr: ColumnDeclaring<T>): BinaryExpression<T>

Multiply operator, translated to * in SQL.

Link copied to clipboard

Cast the current column or expression's type to Double.

Link copied to clipboard

Cast the current column or expression's type to Float.

Link copied to clipboard
@JvmName(name = "booleanToInt")
fun ColumnDeclaring<Boolean>.toInt(): CastingExpression<Int>

Cast the current column or expression's type to Int.

Link copied to clipboard

Cast the current column or expression's type to Long.

Link copied to clipboard

Cast the current column or expression's type to Short.

Link copied to clipboard

Unary minus operator, translated to - in SQL.

Link copied to clipboard

Unary plus operator, translated to + in SQL.

Link copied to clipboard
open override fun wrapArgument(argument: T?): ArgumentExpression<T>

Wrap the given argument as an ArgumentExpression using the sqlType.

Link copied to clipboard

Xor operator, translated to the xor keyword in SQL.