# refresh

open fun refresh(flush: Boolean = false)

Updates the fields of this Entity instance with values retrieved from the database. Override this function to refresh some additional state, if any.

#### Parameters

flush

Whether pending entity changes should be flushed prior to updating.

#### Throws

EntityNotFoundException

If the entity no longer exists in the database.

#### Samples

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