English | 简体中文

api-docs / org.ktorm.expression / UnionExpression

UnionExpression

data class UnionExpression : QueryExpression (source code)

Union expression, represents a union statement of SQL.

Constructors

NameSummary

<init>

UnionExpression(
    left: QueryExpression,
    right: QueryExpression,
    isUnionAll: Boolean,
    orderBy: List<OrderByExpression> = emptyList(),
    offset: Int? = null,
    limit: Int? = null,
    tableAlias: String? = null,
    extraProperties: Map<String, Any> = emptyMap())

Union expression, represents a union statement of SQL.

Properties

NameSummary

extraProperties

val extraProperties: Map<String, Any>

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

isUnionAll

val isUnionAll: Boolean

mark if this union statement is union all.

left

val left: QueryExpression

the left query of this union expression.

limit

val limit: Int?

max record numbers returned by the query.

offset

val offset: Int?

the offset of the first returned record.

orderBy

val orderBy: List<OrderByExpression>

a list of order-by expressions, used in the order by clause of a query.

right

val right: QueryExpression

the right query of this union expression.

tableAlias

val tableAlias: String?

the alias when this query is nested in another query’s source, eg. select * from (...) alias.

Inherited Properties

NameSummary

isLeafNode

val isLeafNode: Boolean

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

Extension Functions

NameSummary

eq

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

Equal operator, translated to = in SQL.

neq

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

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

notEq

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

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