code: public void saveOrUpdate(E e) {
          final Integer id = e.getId();
          final boolean hasId = id != null;
          String createOrUpdatePrefix = hasId ? "Updating" : "Creating a new";
          String idSuffix = hasId ? " with ID " + id : "";
  
          LOG.trace(createOrUpdatePrefix + " instance of " + entityClass.getSimpleName()
              + idSuffix);
  
          e.setModified(DateTime.now());
          getSession().saveOrUpdate(e);
      }
docs: Saves or updates the passed entity.
  
  @param e The entity to save or update in the database.