BatchReplaceStatement

open class BatchReplaceStatement(table: Table, val shouldReturnGeneratedValues: Boolean = true) : BaseBatchInsertStatement

Represents the SQL statement that either batch inserts new rows into a table, or, if insertions violate unique constraints, first deletes the existing rows before inserting new rows.

Parameters

table

Table to either insert values into or delete values from then insert into.

shouldReturnGeneratedValues

Specifies whether newly generated values (for example, auto-incremented IDs) should be returned. See Batch Insert for more details.

Constructors

Link copied to clipboard
constructor(table: Table, shouldReturnGeneratedValues: Boolean = true)

Properties

Link copied to clipboard
open override var arguments: List<List<Pair<Column<*>, Any?>>>?
Link copied to clipboard
Link copied to clipboard

The number of rows affected by the insert operation.

Link copied to clipboard
Link copied to clipboard

The ResultRows generated by processing the database result set retrieved after executing the statement.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The mapping of columns scheduled for change with their new values.

Functions

Link copied to clipboard
fun addBatch()

Adds the most recent batch to the current list of insert statements.

Link copied to clipboard
open override fun arguments(): List<Iterable<Pair<IColumnType<*>, Any?>>>

Returns all mappings of columns and expression types to their values needed to prepare an SQL statement.

Link copied to clipboard

Returns the list of columns with default values that can not be taken locally. It is the columns defined with defaultExpression(), databaseGenerated()

Link copied to clipboard
open operator fun contains(column: Column<*>): Boolean
Link copied to clipboard
infix operator fun <T> get(column: Column<T>): T
infix operator fun <T> get(column: CompositeColumn<T>): T
Link copied to clipboard
fun <T> getOrNull(column: Column<T>): T?

Returns the value of a given column from the first stored ResultRow, or null if either no results were retrieved from the database or if the column cannot be found in the row.

Link copied to clipboard
open override fun prepareSQL(transaction: Transaction, prepared: Boolean): String

Returns the string representation of an SQL statement.

Link copied to clipboard
Link copied to clipboard
open operator override fun <S> set(column: Column<S>, value: S)
open operator fun <T, S : T?, E : Expression<S>> set(column: Column<T>, value: E)
open operator fun <S> set(column: Column<S>, value: AbstractQuery<*>)
@JvmName(name = "setWithEntityIdExpression")
operator fun <S, ID : EntityID<S>, E : Expression<S>> set(column: Column<ID>, value: E)
@JvmName(name = "setWithNullableEntityIdValue")
operator fun <S : Any> set(column: Column<EntityID<S>?>, value: S?)
@JvmName(name = "setWithEntityIdValue")
operator fun <S : Any> set(column: Column<EntityID<S>>, value: S)
open operator fun <S> set(column: CompositeColumn<S>, value: S)
Link copied to clipboard
open fun <T, S : T?> update(column: Column<T>, value: SqlExpressionBuilder.() -> Expression<S>)

Updates the mapping of the specified column with the value of the provided expression.

open fun <T, S : T?> update(column: Column<T>, value: Expression<S>)

Updates the mapping of the specified column with the specified value if column has not been previously set up for a change and if value is of a valid type.

Link copied to clipboard