# wrapRow

fun wrapRow(row: ResultRow): T

Wraps the specified ResultRow data into an Entity instance.

This method updates the entity's internal read values with fresh data from the ResultRow, ensuring that queries like SELECT FOR UPDATE return current database state rather than cached values.

When an entity is already cached and has fields that already accessed columns not present in the new ResultRow, the method performs a selective merge: values from columns present in the ResultRow are used to update the entity with fresh data, while entity fields mapped to previously accessed columns not in the ResultRow retain their cached values.

fun wrapRow(row: ResultRow, alias: Alias<IdTable<*>>): T

Wraps the specified ResultRow data into an Entity instance.

The provided alias will be used to adjust the ResultRow mapping before returning the entity.

#### Samples

org.jetbrains.exposed.v1.tests.shared.AliasesTests.testWrapRowWithAliasedTable

fun wrapRow(row: ResultRow, alias: QueryAlias): T

Wraps the specified ResultRow data into an Entity instance.

The provided alias will be used to adjust the ResultRow mapping before returning the entity.

#### Samples

org.jetbrains.exposed.v1.tests.shared.AliasesTests.testWrapRowWithAliasedQuery