/** * Refresh the state of the instance from the database, overwriting changes * made to the entity, if any. * * @param entity * @throws IllegalArgumentException * if the instance is not an entity or the entity is not managed * @throws TransactionRequiredException * if invoked on a container-managed entity manager of type * PersistenceContextType.TRANSACTION and there is no * transaction * @throws EntityNotFoundException * if the entity no longer exists in the database * @see javax.persistence.EntityManager#refresh(java.lang.Object) */ @Override public final void refresh(Object entity) { checkClosed(); checkTransactionNeeded(); getPersistenceDelegator().refresh(entity); }