Search in sources :

Example 6 with Abreviatura

use of com.tomasio.projects.trainning.model.Abreviatura in project trainning by fernandotomasio.

the class HibernateAbreviaturaDAO method remove.

@Override
public void remove(Long id) throws DAOException {
    Session session = sessionFactory.getCurrentSession();
    Abreviatura abreviatura = (Abreviatura) session.get(Abreviatura.class, id);
    try {
        session.delete(abreviatura);
    } catch (HibernateException e) {
        Logger.getLogger(HibernateAbreviaturaDAO.class.getName()).log(Level.SEVERE, null, e);
        throw new DAOException("Erro ao remover Abreviatura!");
    }
}
Also used : DAOException(com.tomasio.projects.trainning.exception.DAOException) Abreviatura(com.tomasio.projects.trainning.model.Abreviatura) HibernateException(org.hibernate.HibernateException) Session(org.hibernate.Session)

Aggregations

DAOException (com.tomasio.projects.trainning.exception.DAOException)6 Abreviatura (com.tomasio.projects.trainning.model.Abreviatura)6 CoreException (com.tomasio.projects.trainning.exeption.CoreException)4 Transactional (org.springframework.transaction.annotation.Transactional)4 HibernateException (org.hibernate.HibernateException)2 Session (org.hibernate.Session)2 AbreviaturaDTO (com.tomasio.projects.trainning.dto.AbreviaturaDTO)1 Criteria (org.hibernate.Criteria)1