# 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.sql.tests.shared.entities.EntityTests.testDaoFindByIdAndUpdate