use of com.tomasio.projects.trainning.exeption.CoreException in project trainning by fernandotomasio.
the class TeachingDocumentsServiceSimpleImpl method findAllObjetivosDisciplinas.
@Override
@Transactional(readOnly = true)
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
public ObjetivoDisciplinaDTO[] findAllObjetivosDisciplinas(Long disciplinaId) {
ObjetivoDisciplinaDAO dao = factory.getObjetivoDisciplinaDAO();
ObjetivoDisciplinaDTO[] objetivosDisciplinasArray = null;
try {
List<ObjetivoDisciplina> objetivos = dao.findAll(disciplinaId);
objetivosDisciplinasArray = new ObjetivoDisciplinaDTO[objetivos.size()];
for (int i = 0; i < objetivosDisciplinasArray.length; i++) {
objetivosDisciplinasArray[i] = objetivos.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 objetivosDisciplinasArray;
}
use of com.tomasio.projects.trainning.exeption.CoreException in project trainning by fernandotomasio.
the class TeachingDocumentsServiceSimpleImpl method createGrupoAreaConhecimento.
@Override
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
@Transactional
public Long createGrupoAreaConhecimento(GrupoAreaConhecimentoDTO grupoAreaConhecimento) {
AreaConhecimentoDAO dao = factory.getAreaConhecimentoDAO();
GrupoAreaConhecimento _grupo = new GrupoAreaConhecimento(grupoAreaConhecimento);
Long id = null;
try {
id = dao.createGrupoAreaConhecimento(_grupo);
} catch (DAOException ex) {
throw new CoreException(ex.getMessage());
} catch (Exception ex) {
throw new CoreException("Erro de sistema: " + ex.getMessage());
}
return id;
}
use of com.tomasio.projects.trainning.exeption.CoreException in project trainning by fernandotomasio.
the class TeachingDocumentsServiceSimpleImpl method updateCapituloApostila.
@Override
@Transactional
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
public void updateCapituloApostila(CapituloApostilaDTO capitulo) {
CapituloApostilaDAO dao = factory.getCapituloApostilaDAO();
CapituloApostila model = new CapituloApostila(capitulo);
try {
dao.update(model);
} 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.getMessage());
}
}
use of com.tomasio.projects.trainning.exeption.CoreException in project trainning by fernandotomasio.
the class TeachingDocumentsServiceSimpleImpl method findAllDominiosAprendizagem.
@Override
@Transactional(readOnly = true)
public DominioAprendizagemDTO[] findAllDominiosAprendizagem() {
NivelAprendizagemDAO dao = factory.getNivelAprendizagemDAO();
DominioAprendizagemDTO[] dominiosArray = null;
try {
List<DominioAprendizagem> dominios = dao.findAllDominiosAprendizagem();
if (dominios != null) {
dominiosArray = new DominioAprendizagemDTO[dominios.size()];
for (int i = 0; i < dominios.size(); i++) {
dominiosArray[i] = dominios.get(i).createDTO();
}
}
} catch (DAOException ex) {
throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
}
return dominiosArray;
}
use of com.tomasio.projects.trainning.exeption.CoreException in project trainning by fernandotomasio.
the class TeachingDocumentsServiceSimpleImpl method createCurriculoMinimo.
@Override
@Transactional
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
public Long createCurriculoMinimo(CurriculoMinimoDTO curriculo) {
CurriculoMinimoDAO dao = factory.getCurriculoMinimoDAO();
CurriculoMinimo model = new CurriculoMinimo(curriculo);
Long id = null;
try {
id = dao.create(model);
} catch (DAOException ex) {
throw new CoreException(ex.getMessage());
} catch (Exception ex) {
throw new CoreException("Erro de sistema: " + ex.getMessage());
}
return id;
}
Aggregations