Search in sources :

Example 1 with CertificadoConclusaoDAO

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

the class AtividadesEnsinoServiceSimpleImpl method findAllCertificadosConclusaoByConclusao.

@Override
@Transactional(readOnly = true)
public CertificadoConclusaoDTO[] findAllCertificadosConclusaoByConclusao(Long conclusaoId) {
    CertificadoConclusaoDAO dao = factory.getCertificadoConclusaoDAO();
    CertificadoConclusaoDTO[] certificadosArray = null;
    try {
        List<CertificadoConclusao> certificados = dao.findAllCertificadosConclusaoByConclusao(conclusaoId);
        if (certificados != null) {
            certificadosArray = new CertificadoConclusaoDTO[certificados.size()];
            for (int i = 0; i < certificados.size(); i++) {
                certificadosArray[i] = certificados.get(i).createDTO();
            }
        }
    } 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 certificadosArray;
}
Also used : DAOException(com.tomasio.projects.trainning.exception.DAOException) CertificadoConclusaoDTO(com.tomasio.projects.trainning.dto.CertificadoConclusaoDTO) CertificadoConclusao(com.tomasio.projects.trainning.model.CertificadoConclusao) CoreException(com.tomasio.projects.trainning.exeption.CoreException) CertificadoConclusaoDAO(com.tomasio.projects.trainning.dao.CertificadoConclusaoDAO) 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 CertificadoConclusaoDAO

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

the class AtividadesEnsinoServiceSimpleImpl method createCertificadoConclusao.

@Override
@Transactional
public void createCertificadoConclusao(CertificadoConclusaoDTO certificadoConclusao) {
    CertificadoConclusaoDAO dao = factory.getCertificadoConclusaoDAO();
    Long id = null;
    CertificadoConclusao _certificadoConclusao = null;
    // cria um registro na tabela CancelamentoMatricula
    if (certificadoConclusao != null) {
        _certificadoConclusao = new CertificadoConclusao(certificadoConclusao);
    }
    try {
        id = dao.create(_certificadoConclusao);
    } 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());
    // throw new CoreException(ex.getMessage());
    }
// return id;
}
Also used : DAOException(com.tomasio.projects.trainning.exception.DAOException) CertificadoConclusao(com.tomasio.projects.trainning.model.CertificadoConclusao) CoreException(com.tomasio.projects.trainning.exeption.CoreException) CertificadoConclusaoDAO(com.tomasio.projects.trainning.dao.CertificadoConclusaoDAO) 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

CertificadoConclusaoDAO (com.tomasio.projects.trainning.dao.CertificadoConclusaoDAO)2 DAOException (com.tomasio.projects.trainning.exception.DAOException)2 CoreException (com.tomasio.projects.trainning.exeption.CoreException)2 CertificadoConclusao (com.tomasio.projects.trainning.model.CertificadoConclusao)2 ParseException (java.text.ParseException)2 Transactional (org.springframework.transaction.annotation.Transactional)2 CertificadoConclusaoDTO (com.tomasio.projects.trainning.dto.CertificadoConclusaoDTO)1