wherehows-dao/src/main/java/wherehows/dao/table/BaseDao.java
@SneakyThrows
  public Object update(Object record) {
    EntityManager entityManager = entityManagerFactory.createEntityManager();
    entityManager.getTransaction().begin();
    try {
      record = entityManager.merge(record);
      entityManager.getTransaction().commit();
      return record;
    } finally {
      entityManager.close();
    }
  }
/**
   * Merge (update or create) an entity record.
   * @param record an entity object
   * @return the persisted / managed record
   */
Merge (update or create) an entity record.
@param record an entity object
@return the persisted / managed record
Merge ( update or create ) an entity record . @param record an entity object @return the persisted / managed record
@SneakyThrows
  public Object update(Object record) {
    EntityManager entityManager = entityManagerFactory.createEntityManager();
    entityManager.getTransaction().begin();
    try {
      record = entityManager.merge(record);
      entityManager.getTransaction().commit();
      return record;
    } finally {
      entityManager.close();
    }
  }
@ SneakyThrows public Object update ( Object record ) { EntityManager entityManager = entityManagerFactory . createEntityManager ( ) ; entityManager . getTransaction ( ) . begin ( ) ; try { record = entityManager . merge ( record ) ; entityManager . getTransaction ( ) . commit ( ) ; return record ; } finally { entityManager . close ( ) ; } }
Merge (update or create) an entity record.
Merge ( update or create ) an entity record .