setUpsertMask

abstract fun <E : Any> setUpsertMask(vararg props: ImmutableProp)
abstract fun <E : Any> setUpsertMask(vararg props: KProperty1<E, *>)
abstract fun <E : Any> setUpsertMask(vararg props: TypedProp.Single<E, *>)

Set UpsertMask with updatable properties

When upsert is executed, existing rows will be updated. By default, the properties is determined by object shape

updatedProperties = propertiesOf(dynamicEntity) - conflictIdOrKey

If the UpsertMask is specified,

updatedProperties = (
propertiesOf(dynamicEntity) - conflictIdOrKey
) & upsertMask.updatableProps

Parameters

props

Properties that can be updated

    - its length cannot be 0
    - all properties must belong to one entity type

abstract fun setUpsertMask(mask: UpsertMask<*>)

Set UpsertMask object

When upsert is executed, existing rows will be updated and non-existing rows will be inserted. By default, the properties is determined by object shape

insertedProperties = propertiesOf(dynamicEntity)
updatedProperties = propertiesOf(dynamicEntity) - conflictIdOrKey

If the UpsertMask is specified,

insertedProperties = (
propertiesOf(dynamicEntity) & upsertMask.insertableProps
) + conflictIdOrKey
updatedProperties = (
propertiesOf(dynamicEntity) - conflictIdOrKey
) & upsertMask.updatableProps

Parameters

mask

The upsert mask object, it cannot be null