Search in sources :

Example 56 with CoreException

use of com.tomasio.projects.trainning.exeption.CoreException 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 57 with CoreException

use of com.tomasio.projects.trainning.exeption.CoreException 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 58 with CoreException

use of com.tomasio.projects.trainning.exeption.CoreException 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)

Example 59 with CoreException

use of com.tomasio.projects.trainning.exeption.CoreException in project trainning by fernandotomasio.

the class InstructorsServiceSimpleImpl method findHabilitacaoInstrutor.

@Override
@Transactional(readOnly = true)
public HabilitacaoInstrutorDTO findHabilitacaoInstrutor(Long id) {
    HabilitacaoInstrutorDAO dao = factory.getHabilitacaoInstrutorDAO();
    HabilitacaoInstrutor instrutor = null;
    try {
        instrutor = dao.find(id);
    } catch (DAOException ex) {
        throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
    }
    if (instrutor != null) {
        return instrutor.createDTO();
    } else {
        return null;
    }
}
Also used : DAOException(com.tomasio.projects.trainning.exception.DAOException) CoreException(com.tomasio.projects.trainning.exeption.CoreException) HabilitacaoInstrutor(com.tomasio.projects.trainning.model.HabilitacaoInstrutor) Transactional(org.springframework.transaction.annotation.Transactional)

Example 60 with CoreException

use of com.tomasio.projects.trainning.exeption.CoreException in project trainning by fernandotomasio.

the class InstructorsServiceSimpleImpl method findAllConsultaInstrutorByRemetenteId.

@Override
@Transactional(readOnly = true)
public ConsultaInstrutorDTO[] findAllConsultaInstrutorByRemetenteId(Long remetenteId, boolean finalizado) {
    ConsultaInstrutorDAO dao = factory.getConsultaInstrutorDAO();
    ConsultaInstrutorDTO[] consultasArray = null;
    try {
        List<ConsultaInstrutor> consultas = dao.findAllByRemetenteId(remetenteId, finalizado);
        if (consultas != null) {
            consultasArray = new ConsultaInstrutorDTO[consultas.size()];
            for (int i = 0; i < consultas.size(); i++) {
                consultasArray[i] = consultas.get(i).createDTO();
            }
        }
    } catch (DAOException ex) {
        throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
    }
    return consultasArray;
}
Also used : DAOException(com.tomasio.projects.trainning.exception.DAOException) CoreException(com.tomasio.projects.trainning.exeption.CoreException) ConsultaInstrutorDTO(com.tomasio.projects.trainning.dto.ConsultaInstrutorDTO) ConsultaInstrutor(com.tomasio.projects.trainning.model.ConsultaInstrutor) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

CoreException (com.tomasio.projects.trainning.exeption.CoreException)435 DAOException (com.tomasio.projects.trainning.exception.DAOException)388 Transactional (org.springframework.transaction.annotation.Transactional)372 ParseException (java.text.ParseException)91 OrganizacaoDTO (com.tomasio.projects.trainning.dto.OrganizacaoDTO)53 Organizacao (com.tomasio.projects.trainning.model.Organizacao)41 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)40 IndicacaoDAO (com.tomasio.projects.trainning.dao.IndicacaoDAO)30 PreMatriculaDAO (com.tomasio.projects.trainning.dao.PreMatriculaDAO)27 IndicacaoAlunoDTO (com.tomasio.projects.trainning.dto.IndicacaoAlunoDTO)25 PreMatricula (com.tomasio.projects.trainning.model.PreMatricula)25 PessoaDTO (com.tomasio.projects.trainning.dto.PessoaDTO)23 PreMatriculaDTO (com.tomasio.projects.trainning.dto.PreMatriculaDTO)21 CancelamentoMatriculaDAO (com.tomasio.projects.trainning.dao.CancelamentoMatriculaDAO)20 NotificacaoMatriculaDAO (com.tomasio.projects.trainning.dao.NotificacaoMatriculaDAO)20 Date (java.util.Date)20 MatriculaDAO (com.tomasio.projects.trainning.dao.MatriculaDAO)19 TurmaDAO (com.tomasio.projects.trainning.dao.TurmaDAO)19 CancelamentoMatricula (com.tomasio.projects.trainning.model.CancelamentoMatricula)18 Indicacao (com.tomasio.projects.trainning.model.Indicacao)18