findSingleByAndUpdate

fun findSingleByAndUpdate(op: Op<Boolean>, block: (it: T) -> Unit): T?

Gets a single Entity that conforms to the op conditional expression and updates the retrieved entity.

Return

The updated entity that conforms to this condition, or null if either no entity was found or if more than one entity conforms to the condition.

Parameters

op

The conditional expression to use when selecting the entity.

block

Lambda that contains entity field updates.

Samples

org.jetbrains.exposed.sql.tests.shared.entities.EntityTests.testDaoFindSingleByAndUpdate