Search in sources :

Example 1 with ConclusaoDAO

use of com.tomasio.projects.trainning.dao.ConclusaoDAO in project trainning by fernandotomasio.

the class AtividadesEnsinoServiceSimpleImpl method createConclusao.

@Override
@Transactional
public Long createConclusao(ConclusaoDTO conclusao) {
    ConclusaoDAO dao = factory.getConclusaoDAO();
    Conclusao _conclusao = new Conclusao(conclusao);
    try {
        Long id = dao.create(_conclusao);
        return id;
    } catch (DAOException ex) {
        Logger.getLogger(AtividadesEnsinoServiceSimpleImpl.class.getName()).log(Level.SEVERE, null, ex);
        throw new CoreException(ex.getMessage());
    }
}
Also used : DAOException(com.tomasio.projects.trainning.exception.DAOException) CoreException(com.tomasio.projects.trainning.exeption.CoreException) ConclusaoDAO(com.tomasio.projects.trainning.dao.ConclusaoDAO) CertificadoConclusaoDAO(com.tomasio.projects.trainning.dao.CertificadoConclusaoDAO) CertificadoConclusao(com.tomasio.projects.trainning.model.CertificadoConclusao) Conclusao(com.tomasio.projects.trainning.model.Conclusao) Transactional(org.springframework.transaction.annotation.Transactional)

Example 2 with ConclusaoDAO

use of com.tomasio.projects.trainning.dao.ConclusaoDAO in project trainning by fernandotomasio.

the class AtividadesEnsinoServiceSimpleImpl method findAllConcluidosByCapacitacao.

@Override
@Transactional(readOnly = true)
public ConclusaoDTO[] findAllConcluidosByCapacitacao(Long capacitacaoId, boolean aproveitamento) {
    ConclusaoDAO dao = factory.getConclusaoDAO();
    ConclusaoDTO[] concluidosArray = null;
    try {
        List<Conclusao> concluidos = dao.findAllconcluidosByCapacitacao(capacitacaoId, aproveitamento);
        concluidosArray = new ConclusaoDTO[concluidos.size()];
        for (int i = 0; i < concluidosArray.length; i++) {
            concluidosArray[i] = concluidos.get(i).createDTO();
        }
        return concluidosArray;
    } catch (DAOException ex) {
        Logger.getLogger(AtividadesEnsinoServiceSimpleImpl.class.getName()).log(Level.SEVERE, null, ex);
        throw new CoreException(ex.getMessage());
    }
}
Also used : DAOException(com.tomasio.projects.trainning.exception.DAOException) CoreException(com.tomasio.projects.trainning.exeption.CoreException) CertificadoConclusaoDTO(com.tomasio.projects.trainning.dto.CertificadoConclusaoDTO) ConclusaoDTO(com.tomasio.projects.trainning.dto.ConclusaoDTO) ConclusaoDAO(com.tomasio.projects.trainning.dao.ConclusaoDAO) CertificadoConclusaoDAO(com.tomasio.projects.trainning.dao.CertificadoConclusaoDAO) CertificadoConclusao(com.tomasio.projects.trainning.model.CertificadoConclusao) Conclusao(com.tomasio.projects.trainning.model.Conclusao) Transactional(org.springframework.transaction.annotation.Transactional)

Example 3 with ConclusaoDAO

use of com.tomasio.projects.trainning.dao.ConclusaoDAO in project trainning by fernandotomasio.

the class AtividadesEnsinoServiceSimpleImpl method findAllConcluidosByPessoa.

@Override
@Transactional(readOnly = true)
public ConclusaoDTO[] findAllConcluidosByPessoa(Long pessoaId, boolean aproveitamento) {
    ConclusaoDAO dao = factory.getConclusaoDAO();
    ConclusaoDTO[] concluidosArray = null;
    try {
        List<Conclusao> concluidos = dao.findAllConcluidosByPessoa(pessoaId, aproveitamento);
        concluidosArray = new ConclusaoDTO[concluidos.size()];
        for (int i = 0; i < concluidosArray.length; i++) {
            concluidosArray[i] = concluidos.get(i).createDTO();
        }
        return concluidosArray;
    } catch (DAOException ex) {
        Logger.getLogger(AtividadesEnsinoServiceSimpleImpl.class.getName()).log(Level.SEVERE, null, ex);
        throw new CoreException(ex.getMessage());
    }
}
Also used : DAOException(com.tomasio.projects.trainning.exception.DAOException) CoreException(com.tomasio.projects.trainning.exeption.CoreException) CertificadoConclusaoDTO(com.tomasio.projects.trainning.dto.CertificadoConclusaoDTO) ConclusaoDTO(com.tomasio.projects.trainning.dto.ConclusaoDTO) ConclusaoDAO(com.tomasio.projects.trainning.dao.ConclusaoDAO) CertificadoConclusaoDAO(com.tomasio.projects.trainning.dao.CertificadoConclusaoDAO) CertificadoConclusao(com.tomasio.projects.trainning.model.CertificadoConclusao) Conclusao(com.tomasio.projects.trainning.model.Conclusao) Transactional(org.springframework.transaction.annotation.Transactional)

Example 4 with ConclusaoDAO

use of com.tomasio.projects.trainning.dao.ConclusaoDAO in project trainning by fernandotomasio.

the class AtividadesEnsinoServiceSimpleImpl method findAllConcluidos.

@Override
@Transactional(readOnly = true)
public ConclusaoDTO[] findAllConcluidos(Long[] organizacoesIds, Long capacitacaoId, Long turmaId, Long pessoaId, boolean aproveitamento) {
    ConclusaoDAO dao = factory.getConclusaoDAO();
    ConclusaoDTO[] concluidosArray = null;
    try {
        List<Conclusao> concluidos = dao.findAllConcluidos(organizacoesIds, capacitacaoId, turmaId, pessoaId, aproveitamento);
        concluidosArray = new ConclusaoDTO[concluidos.size()];
        for (int i = 0; i < concluidosArray.length; i++) {
            concluidosArray[i] = concluidos.get(i).createDTO();
        }
        return concluidosArray;
    } catch (DAOException ex) {
        Logger.getLogger(AtividadesEnsinoServiceSimpleImpl.class.getName()).log(Level.SEVERE, null, ex);
        throw new CoreException(ex.getMessage());
    }
}
Also used : DAOException(com.tomasio.projects.trainning.exception.DAOException) CoreException(com.tomasio.projects.trainning.exeption.CoreException) CertificadoConclusaoDTO(com.tomasio.projects.trainning.dto.CertificadoConclusaoDTO) ConclusaoDTO(com.tomasio.projects.trainning.dto.ConclusaoDTO) ConclusaoDAO(com.tomasio.projects.trainning.dao.ConclusaoDAO) CertificadoConclusaoDAO(com.tomasio.projects.trainning.dao.CertificadoConclusaoDAO) CertificadoConclusao(com.tomasio.projects.trainning.model.CertificadoConclusao) Conclusao(com.tomasio.projects.trainning.model.Conclusao) Transactional(org.springframework.transaction.annotation.Transactional)

Example 5 with ConclusaoDAO

use of com.tomasio.projects.trainning.dao.ConclusaoDAO in project trainning by fernandotomasio.

the class AtividadesEnsinoServiceSimpleImpl method createConclusao.

@Override
@Transactional
public void createConclusao(ConclusaoDTO[] conclusoes) {
    ConclusaoDAO dao = factory.getConclusaoDAO();
    List<Conclusao> conclusoesList = new ArrayList<Conclusao>();
    for (ConclusaoDTO conclusao : conclusoes) {
        Conclusao _conclusao = new Conclusao(conclusao);
        conclusoesList.add(_conclusao);
    }
    try {
        dao.create(conclusoesList);
    } 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 : DAOException(com.tomasio.projects.trainning.exception.DAOException) CoreException(com.tomasio.projects.trainning.exeption.CoreException) CertificadoConclusaoDTO(com.tomasio.projects.trainning.dto.CertificadoConclusaoDTO) ConclusaoDTO(com.tomasio.projects.trainning.dto.ConclusaoDTO) ConclusaoDAO(com.tomasio.projects.trainning.dao.ConclusaoDAO) CertificadoConclusaoDAO(com.tomasio.projects.trainning.dao.CertificadoConclusaoDAO) CertificadoConclusao(com.tomasio.projects.trainning.model.CertificadoConclusao) Conclusao(com.tomasio.projects.trainning.model.Conclusao) ArrayList(java.util.ArrayList) 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

ConclusaoDAO (com.tomasio.projects.trainning.dao.ConclusaoDAO)11 DAOException (com.tomasio.projects.trainning.exception.DAOException)11 CertificadoConclusaoDAO (com.tomasio.projects.trainning.dao.CertificadoConclusaoDAO)10 CoreException (com.tomasio.projects.trainning.exeption.CoreException)10 Conclusao (com.tomasio.projects.trainning.model.Conclusao)10 Transactional (org.springframework.transaction.annotation.Transactional)10 CertificadoConclusao (com.tomasio.projects.trainning.model.CertificadoConclusao)9 CertificadoConclusaoDTO (com.tomasio.projects.trainning.dto.CertificadoConclusaoDTO)7 ConclusaoDTO (com.tomasio.projects.trainning.dto.ConclusaoDTO)7 ApresentacaoDAO (com.tomasio.projects.trainning.dao.ApresentacaoDAO)1 CursoDAO (com.tomasio.projects.trainning.dao.CursoDAO)1 HibernateConclusaoDAO (com.tomasio.projects.trainning.dao.HibernateConclusaoDAO)1 HibernateCursoDAO (com.tomasio.projects.trainning.dao.HibernateCursoDAO)1 HibernatePessoaDAO (com.tomasio.projects.trainning.dao.HibernatePessoaDAO)1 PessoaDAO (com.tomasio.projects.trainning.dao.PessoaDAO)1 Apresentacao (com.tomasio.projects.trainning.model.Apresentacao)1 Curso (com.tomasio.projects.trainning.model.Curso)1 Periodo (com.tomasio.projects.trainning.model.Periodo)1 Pessoa (com.tomasio.projects.trainning.model.Pessoa)1 ParseException (java.text.ParseException)1