@Transactional
    public void refresh(E entity) {
        if (entityManager.contains(entity)) {
            entityManager.refresh(entity);
        }
    }
@ Transactional public void refresh ( E entity ) { if ( entityManager . contains ( entity ) ) { entityManager . refresh ( entity ) ; } }
Refresh the given entity with up to date data. Does nothing if the given entity is a new entity (not yet managed).

@param entity the entity to refresh.