Search in sources :

Example 6 with Apostila

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

the class HibernateApostilaDAO method remove.

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

Aggregations

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