code: public void refresh(Object entity)
      {
          if (contains(entity))
          {
              MainCache mainCache = (MainCache) getPersistenceCache().getMainCache();
              Node node = mainCache.getNodeFromCache(entity, getMetadata(entity.getClass()), this);
              // Locking as it might read from persistence context.
  
              try
              {
                  lock.readLock().lock();
                  node.setPersistenceDelegator(this);
                  node.refresh();
              }
              finally
              {
                  lock.readLock().unlock();
              }
          }
          else
          {
              throw new IllegalArgumentException("This is not a valid or managed entity, can't be refreshed");
          }
      }
docs: Refresh the state of the instance from the database, overwriting changes
  made to the entity, if any.