# reload

fun reload(entity: Entity<ID>, flush: Boolean = false): T?

Reloads the fields of an entity from the database and returns the entity as a new object.

The original entity will also be removed from the current cache.

#### Parameters

flush

Whether pending entity changes should be flushed prior to reloading.

#### See also

EntityClass.removeFromCache

#### Samples

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