public void delete(@Nonnull Integer id) throws HibernateException {
  EntityManager em=getEntityManager();
  try {
    begin();
    T_ENTITY entity=em.find(entityClass,id);
    if (entity != null) {
      LOG.debug("deleting entity " + entity.toString());
      em.remove(entity);
    }
    commit();
  }
 catch (  Exception e) {
    rollback();
    e.printStackTrace();
    throw new RuntimeException(e);
  }
 finally {
    cleanup();
  }
}

public void delete ( @ Nonnull Integer id ) throws HibernateException { EntityManager em = getEntityManager ( ) ; try { begin ( ) ; T_ENTITY entity = em . find ( entityClass , id ) ; if ( entity != null ) { LOG . debug ( "deleting entity " + entity . toString ( ) ) ; em . remove ( entity ) ; } commit ( ) ; } catch ( Exception e ) { rollback ( ) ; e . printStackTrace ( ) ; throw new RuntimeException ( e ) ; } finally { cleanup ( ) ; } }
deletes the entity from the datastore and applies cascade rules .
