use of com.tomasio.projects.trainning.exception.DAOException in project trainning by fernandotomasio.
the class OrganizationalServiceSimpleImpl method searchComandosBySigla.
@Override
@Transactional(readOnly = true)
public OrganizacaoDTO[] searchComandosBySigla(String term) {
OrganizacaoDAO dao = factory.getOrganizacaoDAO();
OrganizacaoDTO[] organizacoesArray = null;
try {
List<Organizacao> organizacoes = dao.searchComandoBySigla(term);
if (organizacoes != null) {
organizacoesArray = convertToArray(organizacoes);
}
} catch (DAOException ex) {
throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
}
return organizacoesArray;
}
use of com.tomasio.projects.trainning.exception.DAOException in project trainning by fernandotomasio.
the class OrganizationalServiceSimpleImpl method findOrganizacao.
@Override
@Transactional(readOnly = true)
public OrganizacaoDTO findOrganizacao(Long id) {
OrganizacaoDAO dao = factory.getOrganizacaoDAO();
Organizacao organizacao = null;
try {
organizacao = dao.find(id);
} catch (DAOException ex) {
throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
}
if (organizacao != null) {
return organizacao.createDTO();
} else {
return null;
}
}
use of com.tomasio.projects.trainning.exception.DAOException in project trainning by fernandotomasio.
the class MatriculasLoggerAdvice method logCreateMatricula.
@After("create()")
public void logCreateMatricula(JoinPoint joinPoint) {
MatriculaDTO[] matriculas = (MatriculaDTO[]) joinPoint.getArgs()[0];
if (matriculas != null && matriculas.length > 0) {
try {
LogDTO log = new LogDTO();
log.setDataCriacao(new Date());
log.setUser(getUser());
for (MatriculaDTO matriculaDTO : matriculas) {
String texto = "CRIAÇÃO DE MATRÍCULA " + getDetails(matriculaDTO);
log.setTexto(texto);
logger.create(log);
}
} catch (DAOException ex) {
Logger.getLogger(MatriculasLoggerAdvice.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
use of com.tomasio.projects.trainning.exception.DAOException in project trainning by fernandotomasio.
the class TrainningServiceLoggerAdvice method logUpdateCurso.
@After("update()")
public void logUpdateCurso(JoinPoint joinPoint) {
CursoDAO dao = factory.getCursoDAO();
CursoDTO curso = (CursoDTO) joinPoint.getArgs()[0];
if (curso != null) {
try {
curso = dao.find(curso.getId()).createDTO();
LogDTO log = new LogDTO();
log.setDataCriacao(new Date());
log.setUser(getUser());
log.setObjectId(curso.getObjectId());
String texto = "ATUALIZADO O CURSO " + getDetails(curso);
log.setTexto(texto);
logger.create(log);
} catch (DAOException ex) {
Logger.getLogger(TrainningServiceLoggerAdvice.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
use of com.tomasio.projects.trainning.exception.DAOException in project trainning by fernandotomasio.
the class TeachingDocumentsServiceSimpleImpl method createDominioAprendizagem.
@Override
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
@Transactional
public Long createDominioAprendizagem(DominioAprendizagemDTO dominioAprendizagem) {
NivelAprendizagemDAO dao = factory.getNivelAprendizagemDAO();
DominioAprendizagem _dominio = new DominioAprendizagem(dominioAprendizagem);
Long id = null;
try {
id = dao.createDominioAprendizagem(_dominio);
} catch (DAOException ex) {
throw new CoreException(ex.getMessage());
} catch (Exception ex) {
throw new CoreException("Erro de sistema: " + ex.getMessage());
}
return id;
}
Aggregations