English | 简体中文

api-docs / org.ktorm.expression / BetweenExpression

BetweenExpression

data class BetweenExpression<T : Any> : 
    ScalarExpression<Boolean>
(source code)

Between expression, check if a scalar expression is in the given range.

Constructors

NameSummary

<init>

BetweenExpression(
    expression: ScalarExpression<T>,
    lower: ScalarExpression<T>,
    upper: ScalarExpression<T>,
    notBetween: Boolean = false,
    sqlType: SqlType<Boolean> = BooleanSqlType,
    isLeafNode: Boolean = false,
    extraProperties: Map<String, Any> = emptyMap())

Between expression, check if a scalar expression is in the given range.

Properties

NameSummary

expression

val expression: ScalarExpression<T>

the left operand.

extraProperties

val extraProperties: Map<String, Any>

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

isLeafNode

val isLeafNode: Boolean

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

lower

val lower: ScalarExpression<T>

the lower bound of the range.

notBetween

val notBetween: Boolean

mark if this expression is translated to not between.

sqlType

val sqlType: SqlType<Boolean>

The SqlType of this column or expression.

upper

val upper: ScalarExpression<T>

the upper bound of the range.

Inherited Functions

NameSummary

aliased

open fun aliased(
    label: String?
): ColumnDeclaringExpression<T>

Wrap this instance as a ColumnDeclaringExpression.

asExpression

open fun asExpression(): ScalarExpression<T>

Convert this instance to a ScalarExpression.

wrapArgument

open fun wrapArgument(argument: T?): ArgumentExpression<T>

Wrap the given argument as an ArgumentExpression using the sqlType.

Extension Functions

NameSummary

and


infix fun ColumnDeclaring<Boolean>.and(
    value: Boolean
): BinaryExpression<Boolean>

And operator, translated to the and keyword in SQL.

asc

Order this column or expression in ascending order.

cast

fun <T : Any> ColumnDeclaring<*>.cast(
    sqlType: SqlType<T>
): CastingExpression<T>

Cast the current column or expression to the given SqlType.

desc

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

eq

infix fun <T : Any> ColumnDeclaring<T>.eq(
    expr: ColumnDeclaring<T>
): BinaryExpression<Boolean>

infix fun <T : Any> ColumnDeclaring<T>.eq(
    value: T
): BinaryExpression<Boolean>

infix fun <T : Any> T.eq(
    expr: ColumnDeclaring<T>
): BinaryExpression<Boolean>

Equal operator, translated to = in SQL.

ifNull

fun <T : Any> ColumnDeclaring<T>.ifNull(
    right: ColumnDeclaring<T>
): FunctionExpression<T>

fun <T : Any> ColumnDeclaring<T>.ifNull(
    right: T?
): FunctionExpression<T>

MySQL ifnull function, translated to ifnull(left, right).

ifNull

fun <T : Any> ColumnDeclaring<T>.ifNull(
    right: ColumnDeclaring<T>
): FunctionExpression<T>

fun <T : Any> ColumnDeclaring<T>.ifNull(
    right: T?
): FunctionExpression<T>

SQLite ifnull function, translated to ifnull(left, right).

ilike

infix fun ColumnDeclaring<*>.ilike(
    expr: ColumnDeclaring<String>
): ILikeExpression

infix fun ColumnDeclaring<*>.ilike(
    argument: String
): ILikeExpression

ILike operator, translated to the ilike keyword in PostgreSQL.

inList

fun <T : Any> ColumnDeclaring<T>.inList(
    vararg list: T
): InListExpression<T>

infix fun <T : Any> ColumnDeclaring<T>.inList(
    list: Collection<T>
): InListExpression<T>

infix fun <T : Any> ColumnDeclaring<T>.inList(
    query: Query
): InListExpression<T>

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

isNotNull

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

isNull

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

jsonExtract

fun <T : Any> ColumnDeclaring<*>.jsonExtract(
    path: String,
    sqlType: SqlType<T> = sqlTypeOf() ?: error("Cannot detect the result's SqlType, please specify manually.")
): FunctionExpression<T>

SQLite json_extract function, translated to json_extract(column, path).

jsonPatch

fun ColumnDeclaring<*>.jsonPatch(
    right: ColumnDeclaring<*>
): FunctionExpression<String>

SQLite json_patch function, translated to json_patch(left, right).

jsonRemove

fun ColumnDeclaring<*>.jsonRemove(
    path: String
): FunctionExpression<String>

SQLite json_remove function, translated to json_remove(column, path).

jsonValid

SQLite json_valid function, translated to json_valid(column).

like

infix fun ColumnDeclaring<*>.like(
    expr: ColumnDeclaring<String>
): BinaryExpression<Boolean>

infix fun ColumnDeclaring<*>.like(
    value: String
): BinaryExpression<Boolean>

Like operator, translated to the like keyword in SQL.

neq

infix fun <T : Any> ColumnDeclaring<T>.neq(
    expr: ColumnDeclaring<T>
): BinaryExpression<Boolean>

infix fun <T : Any> ColumnDeclaring<T>.neq(
    value: T
): BinaryExpression<Boolean>

infix fun <T : Any> T.neq(
    expr: ColumnDeclaring<T>
): BinaryExpression<Boolean>

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

not

Negative operator, translated to the not keyword in SQL.

notEq

infix fun <T : Any> ColumnDeclaring<T>.notEq(
    expr: ColumnDeclaring<T>
): BinaryExpression<Boolean>

infix fun <T : Any> ColumnDeclaring<T>.notEq(
    value: T
): BinaryExpression<Boolean>

infix fun <T : Any> T.notEq(
    expr: ColumnDeclaring<T>
): BinaryExpression<Boolean>

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

notInList

fun <T : Any> ColumnDeclaring<T>.notInList(
    vararg list: T
): InListExpression<T>

infix fun <T : Any> ColumnDeclaring<T>.notInList(
    list: Collection<T>
): InListExpression<T>

infix fun <T : Any> ColumnDeclaring<T>.notInList(
    query: Query
): InListExpression<T>

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

notLike

infix fun ColumnDeclaring<*>.notLike(
    expr: ColumnDeclaring<String>
): BinaryExpression<Boolean>

infix fun ColumnDeclaring<*>.notLike(
    value: String
): BinaryExpression<Boolean>

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

or


infix fun ColumnDeclaring<Boolean>.or(
    value: Boolean
): BinaryExpression<Boolean>

Or operator, translated to the or keyword in SQL.

toInt

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

xor


infix fun ColumnDeclaring<Boolean>.xor(
    value: Boolean
): BinaryExpression<Boolean>

Xor operator, translated to the xor keyword in SQL.