code: protected E persist(E entity) throws HibernateException {
          currentSession().saveOrUpdate(requireNonNull(entity));
          return entity;
      }
docs: Either save or update the given instance, depending upon resolution of the unsaved-value
  checks (see the manual for discussion of unsaved-value checking).
  <p/>
  This operation cascades to associated instances if the association is mapped with
  <tt>cascade="save-update"</tt>.
  
  @param entity a transient or detached instance containing new or updated state
  @throws HibernateException
  @see Session#saveOrUpdate(Object)