Search in sources :

Example 6 with ComplementacaoInstrucao

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

the class HibernateComplementacaoInstrucaoDAO method remove.

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

Aggregations

DAOException (com.tomasio.projects.trainning.exception.DAOException)6 ComplementacaoInstrucao (com.tomasio.projects.trainning.model.ComplementacaoInstrucao)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 ComplementacaoInstrucaoDTO (com.tomasio.projects.trainning.dto.ComplementacaoInstrucaoDTO)1 Criteria (org.hibernate.Criteria)1