Search in sources :

Example 6 with NivelAprendizagem

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

the class HibernateNivelAprendizagemDAO method removeNivelAprendizagem.

@Override
public void removeNivelAprendizagem(Long id) throws DAOException {
    Session session = sessionFactory.getCurrentSession();
    NivelAprendizagem nivel = (NivelAprendizagem) session.get(NivelAprendizagem.class, id);
    try {
        session.delete(nivel);
    } catch (HibernateException e) {
        Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, null, e);
        throw new DAOException(MessageHelper.getMessage("indicadores.remove.error"));
    }
}
Also used : DAOException(com.tomasio.projects.trainning.exception.DAOException) HibernateException(org.hibernate.HibernateException) NivelAprendizagem(com.tomasio.projects.trainning.model.NivelAprendizagem) Session(org.hibernate.Session)

Aggregations

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