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;
}
Aggregations