Search in sources :

Example 6 with AreaEnsino

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

the class HibernateAreaConhecimentoDAO method removeAreaConhecimento.

@Override
public void removeAreaConhecimento(Long id) throws DAOException {
    Session session = sessionFactory.getCurrentSession();
    AreaEnsino area = (AreaEnsino) session.get(AreaEnsino.class, id);
    try {
        session.delete(area);
    } 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) AreaEnsino(com.tomasio.projects.trainning.model.AreaEnsino) Session(org.hibernate.Session)

Aggregations

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