Search in sources :

Example 6 with CapituloApostila

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

the class HibernateCapituloApostilaDAO method remove.

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

Aggregations

DAOException (com.tomasio.projects.trainning.exception.DAOException)6 CapituloApostila (com.tomasio.projects.trainning.model.CapituloApostila)6 CoreException (com.tomasio.projects.trainning.exeption.CoreException)5 Transactional (org.springframework.transaction.annotation.Transactional)5 CapituloApostilaDTO (com.tomasio.projects.trainning.dto.CapituloApostilaDTO)1 FolderDTO (com.tomasio.projects.trainning.dto.FolderDTO)1 AnexoApostila (com.tomasio.projects.trainning.model.AnexoApostila)1 Apostila (com.tomasio.projects.trainning.model.Apostila)1 SecaoApostila (com.tomasio.projects.trainning.model.SecaoApostila)1 HibernateException (org.hibernate.HibernateException)1 Session (org.hibernate.Session)1