wherehows-dao/src/main/java/wherehows/dao/table/BaseDao.java
@SneakyThrows
  public void remove(Object record) {
    EntityManager entityManager = entityManagerFactory.createEntityManager();
    entityManager.getTransaction().begin();
    try {
      entityManager.remove(entityManager.contains(record) ? record : entityManager.merge(record));
      entityManager.getTransaction().commit();
    } finally {
      entityManager.close();
    }
  }
/**
   * Remove an entity record. If it's detached, try to attach it first.
   * @param record an entity object
   */
Remove an entity record. If it's detached, try to attach it first.
@param record an entity object
Remove an entity record . If it ' s detached try to attach it first . @param record an entity object
@SneakyThrows
  public void remove(Object record) {
    EntityManager entityManager = entityManagerFactory.createEntityManager();
    entityManager.getTransaction().begin();
    try {
      entityManager.remove(entityManager.contains(record) ? record : entityManager.merge(record));
      entityManager.getTransaction().commit();
    } finally {
      entityManager.close();
    }
  }
@ SneakyThrows public void remove ( Object record ) { EntityManager entityManager = entityManagerFactory . createEntityManager ( ) ; entityManager . getTransaction ( ) . begin ( ) ; try { entityManager . remove ( entityManager . contains ( record ) ? record : entityManager . merge ( record ) ) ; entityManager . getTransaction ( ) . commit ( ) ; } finally { entityManager . close ( ) ; } }
Remove an entity record.
Remove an entity record .