Search in sources :

Example 6 with RecomendacaoMetodologica

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

the class TeachingDocumentsServiceSimpleImpl method findAllRecomendacoesMetodologicasByDisciplina.

@Override
@Transactional(readOnly = true)
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
public RecomendacaoMetodologicaDTO[] findAllRecomendacoesMetodologicasByDisciplina(Long disciplinaId) {
    RecomendacaoMetodologicaDAO dao = factory.getRecomendacaoMetodologicaDAO();
    RecomendacaoMetodologicaDTO[] recomendacaosArray = null;
    try {
        List<RecomendacaoMetodologica> recomendacaos = dao.findAll(disciplinaId);
        recomendacaosArray = new RecomendacaoMetodologicaDTO[recomendacaos.size()];
        for (int i = 0; i < recomendacaosArray.length; i++) {
            recomendacaosArray[i] = recomendacaos.get(i).createDTO();
        }
    } catch (DAOException ex) {
        throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
    } catch (Exception ex) {
        throw new CoreException("Erro de sistema: " + ex.toString());
    }
    return recomendacaosArray;
}
Also used : DAOException(com.tomasio.projects.trainning.exception.DAOException) CoreException(com.tomasio.projects.trainning.exeption.CoreException) RecomendacaoMetodologica(com.tomasio.projects.trainning.model.RecomendacaoMetodologica) RecomendacaoMetodologicaDTO(com.tomasio.projects.trainning.dto.RecomendacaoMetodologicaDTO) CoreException(com.tomasio.projects.trainning.exeption.CoreException) DAOException(com.tomasio.projects.trainning.exception.DAOException) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

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