Search in sources :

Example 6 with Conceituacao

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

the class HibernateConceituacaoDAO method findAll.

@Override
public List<Conceituacao> findAll(Long pudId) throws DAOException {
    Session session = sessionFactory.getCurrentSession();
    try {
        Criteria criteria = session.createCriteria(Conceituacao.class);
        criteria.add(Restrictions.eq("curriculoMinimo.id", pudId));
        @SuppressWarnings("unchecked") List<Conceituacao> conceituacoes = criteria.list();
        return conceituacoes;
    } catch (HibernateException e) {
        Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, null, e);
        throw new DAOException(MessageHelper.getMessage("conceituacoes.find.list.error"));
    }
}
Also used : DAOException(com.tomasio.projects.trainning.exception.DAOException) Conceituacao(com.tomasio.projects.trainning.model.Conceituacao) HibernateException(org.hibernate.HibernateException) Criteria(org.hibernate.Criteria) Session(org.hibernate.Session)

Aggregations

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