Search in sources :

Example 1 with IndicacaoInstrutor

use of com.tomasio.projects.trainning.model.IndicacaoInstrutor in project trainning by fernandotomasio.

the class AtividadesEnsinoServiceSimpleImpl method findAllIndicacoesInstrutores.

@Override
@Transactional(readOnly = true)
public IndicacaoInstrutorDTO[] findAllIndicacoesInstrutores(Long turmaId) {
    IndicacaoDAO dao = factory.getIndicacaoDAO();
    IndicacaoInstrutorDTO[] indicacoesArray = null;
    try {
        List<IndicacaoInstrutor> indicacoes = dao.findAllInstrutores(turmaId);
        if (indicacoes != null) {
            indicacoesArray = new IndicacaoInstrutorDTO[indicacoes.size()];
            for (int i = 0; i < indicacoes.size(); i++) {
                indicacoesArray[i] = indicacoes.get(i).createDTOWithoutDependencies();
            }
        }
    } catch (DAOException ex) {
        ex.printStackTrace();
        throw new CoreException(ex.getMessage());
    } catch (Exception ex) {
        ex.printStackTrace();
        throw new CoreException("Erro em tempo de execução: " + ex.getMessage());
    }
    return indicacoesArray;
}
Also used : IndicacaoDAO(com.tomasio.projects.trainning.dao.IndicacaoDAO) DAOException(com.tomasio.projects.trainning.exception.DAOException) CoreException(com.tomasio.projects.trainning.exeption.CoreException) IndicacaoInstrutor(com.tomasio.projects.trainning.model.IndicacaoInstrutor) IndicacaoInstrutorDTO(com.tomasio.projects.trainning.dto.IndicacaoInstrutorDTO) DAOException(com.tomasio.projects.trainning.exception.DAOException) ParseException(java.text.ParseException) CoreException(com.tomasio.projects.trainning.exeption.CoreException) Transactional(org.springframework.transaction.annotation.Transactional)

Example 2 with IndicacaoInstrutor

use of com.tomasio.projects.trainning.model.IndicacaoInstrutor in project trainning by fernandotomasio.

the class AtividadesEnsinoServiceSimpleImpl method createIndicacao.

@Override
@Transactional
public Long createIndicacao(IndicacaoDTO indicacao) {
    IndicacaoDAO dao = factory.getIndicacaoDAO();
    OrganizacaoDAO organizacaoDAO = factory.getOrganizacaoDAO();
    TurmaDAO turmaDAO = factory.getTurmaDAO();
    Indicacao _indicacao = null;
    if (indicacao != null) {
        if (indicacao instanceof IndicacaoAlunoDTO) {
            _indicacao = new IndicacaoAluno((IndicacaoAlunoDTO) indicacao);
        } else {
            _indicacao = new IndicacaoInstrutor((IndicacaoInstrutorDTO) indicacao);
        }
    }
    Long id = null;
    try {
        id = dao.create(_indicacao);
        updateWorkflowActors(_indicacao.getId());
    } catch (DAOException ex) {
        throw new CoreException(ex.getMessage());
    } catch (Exception ex) {
        ex.printStackTrace();
        throw new CoreException("Erro em tempo de execução: " + ex.getMessage());
    }
    return id;
}
Also used : IndicacaoDAO(com.tomasio.projects.trainning.dao.IndicacaoDAO) IndicacaoAlunoDTO(com.tomasio.projects.trainning.dto.IndicacaoAlunoDTO) DAOException(com.tomasio.projects.trainning.exception.DAOException) OrganizacaoDAO(com.tomasio.projects.trainning.dao.OrganizacaoDAO) IndicacaoAluno(com.tomasio.projects.trainning.model.IndicacaoAluno) CoreException(com.tomasio.projects.trainning.exeption.CoreException) Indicacao(com.tomasio.projects.trainning.model.Indicacao) IndicacaoInstrutor(com.tomasio.projects.trainning.model.IndicacaoInstrutor) TurmaDAO(com.tomasio.projects.trainning.dao.TurmaDAO) IndicacaoInstrutorDTO(com.tomasio.projects.trainning.dto.IndicacaoInstrutorDTO) DAOException(com.tomasio.projects.trainning.exception.DAOException) ParseException(java.text.ParseException) CoreException(com.tomasio.projects.trainning.exeption.CoreException) Transactional(org.springframework.transaction.annotation.Transactional)

Example 3 with IndicacaoInstrutor

use of com.tomasio.projects.trainning.model.IndicacaoInstrutor in project trainning by fernandotomasio.

the class AtividadesEnsinoServiceSimpleImpl method findAllIndicacoesInstrutoresSelecionados.

@Override
@Transactional(readOnly = true)
public IndicacaoInstrutorDTO[] findAllIndicacoesInstrutoresSelecionados(Long turmaId) {
    IndicacaoDAO dao = factory.getIndicacaoDAO();
    IndicacaoInstrutorDTO[] indicacoesArray = null;
    try {
        List<IndicacaoInstrutor> indicacoes = dao.findAllInstrutoresSelecionados(turmaId);
        if (indicacoes != null) {
            indicacoesArray = new IndicacaoInstrutorDTO[indicacoes.size()];
            for (int i = 0; i < indicacoes.size(); i++) {
                indicacoesArray[i] = indicacoes.get(i).createDTOWithoutDependencies();
            }
        }
    } catch (DAOException ex) {
        ex.printStackTrace();
        throw new CoreException(ex.getMessage());
    } catch (Exception ex) {
        ex.printStackTrace();
        throw new CoreException("Erro em tempo de execução: " + ex.getMessage());
    }
    return indicacoesArray;
}
Also used : IndicacaoDAO(com.tomasio.projects.trainning.dao.IndicacaoDAO) DAOException(com.tomasio.projects.trainning.exception.DAOException) CoreException(com.tomasio.projects.trainning.exeption.CoreException) IndicacaoInstrutor(com.tomasio.projects.trainning.model.IndicacaoInstrutor) IndicacaoInstrutorDTO(com.tomasio.projects.trainning.dto.IndicacaoInstrutorDTO) DAOException(com.tomasio.projects.trainning.exception.DAOException) ParseException(java.text.ParseException) CoreException(com.tomasio.projects.trainning.exeption.CoreException) Transactional(org.springframework.transaction.annotation.Transactional)

Example 4 with IndicacaoInstrutor

use of com.tomasio.projects.trainning.model.IndicacaoInstrutor in project trainning by fernandotomasio.

the class AtividadesEnsinoServiceSimpleImpl method findAllIndicacoesInstrutores.

@Override
@Transactional(readOnly = true)
public IndicacaoInstrutorDTO[] findAllIndicacoesInstrutores() {
    IndicacaoDAO dao = factory.getIndicacaoDAO();
    IndicacaoInstrutorDTO[] indicacoesArray = null;
    try {
        List<IndicacaoInstrutor> indicacoes = dao.findAllInstrutores();
        if (indicacoes != null) {
            indicacoesArray = new IndicacaoInstrutorDTO[indicacoes.size()];
            for (int i = 0; i < indicacoes.size(); i++) {
                indicacoesArray[i] = indicacoes.get(i).createDTOWithoutDependencies();
            }
        }
    } catch (DAOException ex) {
        ex.printStackTrace();
        throw new CoreException(ex.getMessage());
    } catch (Exception ex) {
        ex.printStackTrace();
        throw new CoreException("Erro em tempo de execução: " + ex.getMessage());
    }
    return indicacoesArray;
}
Also used : IndicacaoDAO(com.tomasio.projects.trainning.dao.IndicacaoDAO) DAOException(com.tomasio.projects.trainning.exception.DAOException) CoreException(com.tomasio.projects.trainning.exeption.CoreException) IndicacaoInstrutor(com.tomasio.projects.trainning.model.IndicacaoInstrutor) IndicacaoInstrutorDTO(com.tomasio.projects.trainning.dto.IndicacaoInstrutorDTO) DAOException(com.tomasio.projects.trainning.exception.DAOException) ParseException(java.text.ParseException) CoreException(com.tomasio.projects.trainning.exeption.CoreException) Transactional(org.springframework.transaction.annotation.Transactional)

Example 5 with IndicacaoInstrutor

use of com.tomasio.projects.trainning.model.IndicacaoInstrutor in project trainning by fernandotomasio.

the class AtividadesEnsinoServiceSimpleImpl method updateIndicacao.

@Override
@Transactional
public void updateIndicacao(IndicacaoDTO indicacao) {
    IndicacaoDAO dao = factory.getIndicacaoDAO();
    Indicacao _indicacao = null;
    if (indicacao != null) {
        if (indicacao instanceof IndicacaoAlunoDTO) {
            _indicacao = new IndicacaoAluno((IndicacaoAlunoDTO) indicacao);
        } else {
            _indicacao = new IndicacaoInstrutor((IndicacaoInstrutorDTO) indicacao);
        }
    }
    try {
        dao.update(_indicacao);
    } catch (DAOException ex) {
        ex.printStackTrace();
        throw new CoreException(ex.getMessage());
    } catch (Exception ex) {
        ex.printStackTrace();
        throw new CoreException("Erro em tempo de execução: " + ex.getMessage());
    }
}
Also used : IndicacaoDAO(com.tomasio.projects.trainning.dao.IndicacaoDAO) IndicacaoAlunoDTO(com.tomasio.projects.trainning.dto.IndicacaoAlunoDTO) DAOException(com.tomasio.projects.trainning.exception.DAOException) IndicacaoAluno(com.tomasio.projects.trainning.model.IndicacaoAluno) CoreException(com.tomasio.projects.trainning.exeption.CoreException) Indicacao(com.tomasio.projects.trainning.model.Indicacao) IndicacaoInstrutor(com.tomasio.projects.trainning.model.IndicacaoInstrutor) IndicacaoInstrutorDTO(com.tomasio.projects.trainning.dto.IndicacaoInstrutorDTO) DAOException(com.tomasio.projects.trainning.exception.DAOException) ParseException(java.text.ParseException) CoreException(com.tomasio.projects.trainning.exeption.CoreException) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

IndicacaoDAO (com.tomasio.projects.trainning.dao.IndicacaoDAO)8 DAOException (com.tomasio.projects.trainning.exception.DAOException)8 IndicacaoInstrutor (com.tomasio.projects.trainning.model.IndicacaoInstrutor)8 IndicacaoInstrutorDTO (com.tomasio.projects.trainning.dto.IndicacaoInstrutorDTO)5 CoreException (com.tomasio.projects.trainning.exeption.CoreException)5 ParseException (java.text.ParseException)5 Transactional (org.springframework.transaction.annotation.Transactional)5 IndicacaoAluno (com.tomasio.projects.trainning.model.IndicacaoAluno)4 HibernateIndicacaoDAO (com.tomasio.projects.trainning.dao.HibernateIndicacaoDAO)3 HibernateMatriculaDAO (com.tomasio.projects.trainning.dao.HibernateMatriculaDAO)2 HibernatePreMatriculaDAO (com.tomasio.projects.trainning.dao.HibernatePreMatriculaDAO)2 MatriculaDAO (com.tomasio.projects.trainning.dao.MatriculaDAO)2 OrganizacaoDAO (com.tomasio.projects.trainning.dao.OrganizacaoDAO)2 PreMatriculaDAO (com.tomasio.projects.trainning.dao.PreMatriculaDAO)2 IndicacaoAlunoDTO (com.tomasio.projects.trainning.dto.IndicacaoAlunoDTO)2 Indicacao (com.tomasio.projects.trainning.model.Indicacao)2 HashMap (java.util.HashMap)2 List (java.util.List)2 HibernateOrganizacaoDAO (com.tomasio.projects.trainning.dao.HibernateOrganizacaoDAO)1 HibernatePessoaDAO (com.tomasio.projects.trainning.dao.HibernatePessoaDAO)1