Search in sources :

Example 1 with Conclusao

use of com.tomasio.projects.trainning.model.Conclusao 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 Conclusao

use of com.tomasio.projects.trainning.model.Conclusao 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 Conclusao

use of com.tomasio.projects.trainning.model.Conclusao 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 Conclusao

use of com.tomasio.projects.trainning.model.Conclusao 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 Conclusao

use of com.tomasio.projects.trainning.model.Conclusao 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

DAOException (com.tomasio.projects.trainning.exception.DAOException)17 Conclusao (com.tomasio.projects.trainning.model.Conclusao)17 CertificadoConclusao (com.tomasio.projects.trainning.model.CertificadoConclusao)12 ConclusaoDAO (com.tomasio.projects.trainning.dao.ConclusaoDAO)10 CertificadoConclusaoDAO (com.tomasio.projects.trainning.dao.CertificadoConclusaoDAO)9 CoreException (com.tomasio.projects.trainning.exeption.CoreException)9 Transactional (org.springframework.transaction.annotation.Transactional)9 CertificadoConclusaoDTO (com.tomasio.projects.trainning.dto.CertificadoConclusaoDTO)7 ConclusaoDTO (com.tomasio.projects.trainning.dto.ConclusaoDTO)7 Session (org.hibernate.Session)7 HibernateException (org.hibernate.HibernateException)6 ArrayList (java.util.ArrayList)4 ParseException (java.text.ParseException)3 SimpleDateFormat (java.text.SimpleDateFormat)3 Criteria (org.hibernate.Criteria)2 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