# 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

removeFromCache

#### Samples

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