Search in sources :

Example 6 with Referencia

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

the class HibernateReferenciaDAO method remove.

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

Aggregations

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