exposed-jdbc/src/main/kotlin/org/jetbrains/exposed/v1/jdbc/SetOperations.kt [35:71]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - get() = TransactionManager.current() /** The SQL statement on the left-hand side of the set operator. */ val firstStatement: AbstractQuery<*> = when (_firstStatement) { is Query -> { val newSlice = _firstStatement.set.fields.mapIndexed { index, expression -> when (expression) { is Column<*>, is IExpressionAlias<*> -> expression is ExpressionWithColumnType<*> -> expression.alias("exp$index") else -> expression.alias("exp$index") } } _firstStatement.copy().adjustSelect { select(newSlice) } } is SetOperation -> _firstStatement else -> error("Unsupported statement type ${_firstStatement::class.simpleName} in $operationName") } private val rawStatements: List> = listOf(firstStatement, secondStatement) init { require(rawStatements.isNotEmpty()) { "$operationName is empty" } require(rawStatements.none { it is Query && it.isForUpdate() }) { "FOR UPDATE is not allowed within $operationName" } require(rawStatements.map { it.set.realFields.size }.distinct().size == 1) { "Each $operationName query must have the same number of columns" } if (!currentDialect.supportsSubqueryUnions) { require(rawStatements.none { q -> q.orderByExpressions.isNotEmpty() || q.limit != null }) { "$operationName may not contain subqueries" } } } override val set: FieldSet = firstStatement.set /** The SQL keyword representing the set operation. */ open val operationName = operationName - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - exposed-r2dbc/src/main/kotlin/org/jetbrains/exposed/v1/r2dbc/SetOperations.kt [37:73]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - get() = TransactionManager.current() /** The SQL statement on the left-hand side of the set operator. */ val firstStatement: AbstractQuery<*> = when (_firstStatement) { is Query -> { val newSlice = _firstStatement.set.fields.mapIndexed { index, expression -> when (expression) { is Column<*>, is IExpressionAlias<*> -> expression is ExpressionWithColumnType<*> -> expression.alias("exp$index") else -> expression.alias("exp$index") } } _firstStatement.copy().adjustSelect { select(newSlice) } } is SetOperation -> _firstStatement else -> error("Unsupported statement type ${_firstStatement::class.simpleName} in $operationName") } private val rawStatements: List> = listOf(firstStatement, secondStatement) init { require(rawStatements.isNotEmpty()) { "$operationName is empty" } require(rawStatements.none { it is Query && it.isForUpdate() }) { "FOR UPDATE is not allowed within $operationName" } require(rawStatements.map { it.set.realFields.size }.distinct().size == 1) { "Each $operationName query must have the same number of columns" } if (!currentDialect.supportsSubqueryUnions) { require(rawStatements.none { q -> q.orderByExpressions.isNotEmpty() || q.limit != null }) { "$operationName may not contain subqueries" } } } override val set: FieldSet = firstStatement.set /** The SQL keyword representing the set operation. */ open val operationName = operationName - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -