Back to Exposed

findByIdAndUpdate

docs/api/exposed-dao/org.jetbrains.exposed.v1.dao/-entity-class/find-by-id-and-update.html

1.2.0708 B
Original Source

findByIdAndUpdate

fun findByIdAndUpdate(id: ID, block: (it: T) -> Unit): T?

Gets an Entity by its id value and updates the retrieved entity.

Return

The updated entity that has this id value, or null if no entity was found.

Parameters

id

The id value of the entity.

block

Lambda that contains entity field updates.

Samples

org.jetbrains.exposed.v1.tests.shared.entities.EntityTests.testDaoFindByIdAndUpdate

Generated by Dokka © 2026 Copyright