Search in sources :

Example 36 with DAOException

use of com.tomasio.projects.trainning.exception.DAOException in project trainning by fernandotomasio.

the class TeachingDocumentsServiceSimpleImpl method updateRecomendacaoMetodologica.

@Override
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
@Transactional
public void updateRecomendacaoMetodologica(RecomendacaoMetodologicaDTO recomendacao) {
    RecomendacaoMetodologicaDAO dao = factory.getRecomendacaoMetodologicaDAO();
    RecomendacaoMetodologica model = new RecomendacaoMetodologica(recomendacao);
    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());
    }
}
Also used : DAOException(com.tomasio.projects.trainning.exception.DAOException) CoreException(com.tomasio.projects.trainning.exeption.CoreException) RecomendacaoMetodologica(com.tomasio.projects.trainning.model.RecomendacaoMetodologica) CoreException(com.tomasio.projects.trainning.exeption.CoreException) DAOException(com.tomasio.projects.trainning.exception.DAOException) Transactional(org.springframework.transaction.annotation.Transactional)

Example 37 with DAOException

use of com.tomasio.projects.trainning.exception.DAOException in project trainning by fernandotomasio.

the class TeachingDocumentsServiceSimpleImpl method updateGrupoAreaConhecimento.

@Override
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
@Transactional
public void updateGrupoAreaConhecimento(GrupoAreaConhecimentoDTO grupoAreaConhecimento) {
    AreaConhecimentoDAO dao = factory.getAreaConhecimentoDAO();
    GrupoAreaConhecimento _grupo = new GrupoAreaConhecimento(grupoAreaConhecimento);
    Long id = null;
    try {
        dao.updateGrupoAreaConhecimento(_grupo);
    } catch (DAOException ex) {
        throw new CoreException(ex.getMessage());
    } catch (Exception ex) {
        throw new CoreException("Erro de sistema: " + ex.getMessage());
    }
}
Also used : DAOException(com.tomasio.projects.trainning.exception.DAOException) CoreException(com.tomasio.projects.trainning.exeption.CoreException) GrupoAreaConhecimento(com.tomasio.projects.trainning.model.GrupoAreaConhecimento) CoreException(com.tomasio.projects.trainning.exeption.CoreException) DAOException(com.tomasio.projects.trainning.exception.DAOException) Transactional(org.springframework.transaction.annotation.Transactional)

Example 38 with DAOException

use of com.tomasio.projects.trainning.exception.DAOException in project trainning by fernandotomasio.

the class TeachingDocumentsServiceSimpleImpl method updateCurriculoMinimo.

@Override
@Transactional
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
public void updateCurriculoMinimo(CurriculoMinimoDTO curriculo) {
    CurriculoMinimoDAO dao = factory.getCurriculoMinimoDAO();
    CurriculoMinimo model = new CurriculoMinimo(curriculo);
    try {
        dao.update(model);
    } catch (DAOException ex) {
        throw new CoreException(ex.getMessage());
    } catch (Exception ex) {
        throw new CoreException("Erro de sistema: " + ex.getMessage());
    }
}
Also used : DAOException(com.tomasio.projects.trainning.exception.DAOException) CoreException(com.tomasio.projects.trainning.exeption.CoreException) CurriculoMinimo(com.tomasio.projects.trainning.model.CurriculoMinimo) CoreException(com.tomasio.projects.trainning.exeption.CoreException) DAOException(com.tomasio.projects.trainning.exception.DAOException) Transactional(org.springframework.transaction.annotation.Transactional)

Example 39 with DAOException

use of com.tomasio.projects.trainning.exception.DAOException in project trainning by fernandotomasio.

the class InstructorsServiceSimpleImpl method findAllMatriculasInstrutores.

@Override
@Transactional(readOnly = true)
public MatriculaDTO[] findAllMatriculasInstrutores(Long cursoId, Long pessoaId) {
    MatriculaDAO dao = factory.getMatriculaDAO();
    MatriculaDTO[] matriculasArray = null;
    try {
        List<Matricula> matriculas = dao.findAllInstrutoresByCurso(cursoId, pessoaId);
        if (matriculas != null) {
            matriculasArray = new MatriculaDTO[matriculas.size()];
            for (int i = 0; i < matriculas.size(); i++) {
                matriculasArray[i] = matriculas.get(i).createDTO();
            }
        }
    } catch (DAOException ex) {
        throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
    }
    return matriculasArray;
}
Also used : MatriculaDTO(com.tomasio.projects.trainning.dto.MatriculaDTO) DAOException(com.tomasio.projects.trainning.exception.DAOException) CoreException(com.tomasio.projects.trainning.exeption.CoreException) Matricula(com.tomasio.projects.trainning.model.Matricula) Transactional(org.springframework.transaction.annotation.Transactional)

Example 40 with DAOException

use of com.tomasio.projects.trainning.exception.DAOException in project trainning by fernandotomasio.

the class InstructorsServiceSimpleImpl method findAllHabilitacoesInstrutoresInativas.

@Override
@Transactional(readOnly = true)
public HabilitacaoInstrutorEfetivaDTO[] findAllHabilitacoesInstrutoresInativas(Long cursoId, Long organizacaoId, Long pessoaId) {
    HabilitacaoInstrutorDAO dao = factory.getHabilitacaoInstrutorDAO();
    HabilitacaoInstrutorEfetivaDTO[] instrutorsArray = null;
    try {
        List<HabilitacaoInstrutorEfetiva> instrutores = dao.findAllHabilitacoesInativas(cursoId, organizacaoId, pessoaId);
        if (instrutores != null) {
            instrutorsArray = new HabilitacaoInstrutorEfetivaDTO[instrutores.size()];
            for (int i = 0; i < instrutores.size(); i++) {
                instrutorsArray[i] = instrutores.get(i).createDTO();
            }
        }
    } catch (DAOException ex) {
        throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
    }
    return instrutorsArray;
}
Also used : DAOException(com.tomasio.projects.trainning.exception.DAOException) HabilitacaoInstrutorEfetiva(com.tomasio.projects.trainning.model.HabilitacaoInstrutorEfetiva) CoreException(com.tomasio.projects.trainning.exeption.CoreException) HabilitacaoInstrutorEfetivaDTO(com.tomasio.projects.trainning.dto.HabilitacaoInstrutorEfetivaDTO) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

DAOException (com.tomasio.projects.trainning.exception.DAOException)643 CoreException (com.tomasio.projects.trainning.exeption.CoreException)388 Transactional (org.springframework.transaction.annotation.Transactional)385 HibernateException (org.hibernate.HibernateException)186 Session (org.hibernate.Session)186 ParseException (java.text.ParseException)112 Organizacao (com.tomasio.projects.trainning.model.Organizacao)77 ArrayList (java.util.ArrayList)57 Criteria (org.hibernate.Criteria)51 Pessoa (com.tomasio.projects.trainning.model.Pessoa)46 IndicacaoDAO (com.tomasio.projects.trainning.dao.IndicacaoDAO)37 OrganizacaoDTO (com.tomasio.projects.trainning.dto.OrganizacaoDTO)37 TurmaEfetiva (com.tomasio.projects.trainning.model.TurmaEfetiva)33 PreMatriculaDAO (com.tomasio.projects.trainning.dao.PreMatriculaDAO)32 PreMatricula (com.tomasio.projects.trainning.model.PreMatricula)30 StatusTurmaEfetiva (com.tomasio.projects.trainning.model.StatusTurmaEfetiva)30 Matricula (com.tomasio.projects.trainning.model.Matricula)29 SimpleDateFormat (java.text.SimpleDateFormat)28 MatriculaDAO (com.tomasio.projects.trainning.dao.MatriculaDAO)26 TurmaDAO (com.tomasio.projects.trainning.dao.TurmaDAO)26