Column

data class Column<T : Any>(val table: BaseTable<*>, val name: String, val binding: ColumnBinding? = null, val extraBindings: List<ColumnBinding> = emptyList(), val sqlType: SqlType<T>) : ColumnDeclaring<T> (source)

Represents database columns.

Constructors

Link copied to clipboard
constructor(table: BaseTable<*>, name: String, binding: ColumnBinding? = null, extraBindings: List<ColumnBinding> = emptyList(), sqlType: SqlType<T>)

Properties

Link copied to clipboard

Return all the bindings of this column, including the primary binding and extraBindings.

Link copied to clipboard
val binding: ColumnBinding? = null

The column's primary binding. A column might be bound to a simple property, nested properties, or a reference to another table, null if the column doesn't bind to any property.

Link copied to clipboard

The column's extra bindings. Useful when we need to configure two or more bindings for a column.

Link copied to clipboard

The column's label, used to identify the selected columns and to obtain query results.

Link copied to clipboard

The column's name.

Link copied to clipboard

If the column is bound to a reference table, return the table, otherwise return null.

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

The SqlType of this column or expression.

Link copied to clipboard

The table that this column belongs to.

Functions

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

Wrap this column 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(): ColumnExpression<T>

Convert this column to a ColumnExpression.

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
open operator override fun equals(other: Any?): Boolean

Indicates whether some other object is "equal to" this column. Two columns are equal only if they are the same instance.

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
open override fun hashCode(): Int

Return a hash code value for this column.

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
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
open override fun toString(): String

Return a string representation of this column.

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.