Search in sources :

Example 6 with ObjetivoDisciplina

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

the class HibernateObjetivoDisciplinaDAO method remove.

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

Aggregations

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