Search in sources :

Example 1 with ConfirmacaoConviteInstrutorDAO

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

the class AtividadesEnsinoServiceSimpleImpl method updateConfirmacaoConviteInstrutor.

@Override
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
@Transactional
public void updateConfirmacaoConviteInstrutor(ConfirmacaoConviteInstrutorDTO confirmacao) {
    ConfirmacaoConviteInstrutorDAO dao = factory.getConfirmacaoConviteInstrutorDAO();
    ConfirmacaoConviteInstrutor model = new ConfirmacaoConviteInstrutor(confirmacao);
    try {
        dao.update(model);
    } catch (DAOException ex) {
        Logger.getLogger(AtividadesEnsinoServiceSimpleImpl.class.getName()).log(Level.SEVERE, null, ex);
        throw new CoreException(ex.getMessage());
    } catch (Exception ex) {
        Logger.getLogger(AtividadesEnsinoServiceSimpleImpl.class.getName()).log(Level.SEVERE, null, ex);
        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) ConfirmacaoConviteInstrutorDAO(com.tomasio.projects.trainning.dao.ConfirmacaoConviteInstrutorDAO) ConfirmacaoConviteInstrutor(com.tomasio.projects.trainning.model.ConfirmacaoConviteInstrutor) 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 ConfirmacaoConviteInstrutorDAO

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

the class AtividadesEnsinoServiceSimpleImpl method findConfirmacaoConviteInstrutor.

@Override
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
@Transactional(readOnly = true)
public ConfirmacaoConviteInstrutorDTO findConfirmacaoConviteInstrutor(Long confirmacaoId) {
    ConfirmacaoConviteInstrutorDAO dao = factory.getConfirmacaoConviteInstrutorDAO();
    ConfirmacaoConviteInstrutor confirmacao = null;
    try {
        confirmacao = dao.find(confirmacaoId);
    } catch (DAOException ex) {
        Logger.getLogger(AtividadesEnsinoServiceSimpleImpl.class.getName()).log(Level.SEVERE, null, ex);
        throw new CoreException(ex.getMessage());
    } catch (Exception ex) {
        Logger.getLogger(AtividadesEnsinoServiceSimpleImpl.class.getName()).log(Level.SEVERE, null, ex);
        throw new CoreException("Erro em tempo de execução: " + ex.getMessage());
    }
    if (confirmacao != null) {
        return confirmacao.createDTO();
    } else {
        return null;
    }
}
Also used : DAOException(com.tomasio.projects.trainning.exception.DAOException) CoreException(com.tomasio.projects.trainning.exeption.CoreException) ConfirmacaoConviteInstrutorDAO(com.tomasio.projects.trainning.dao.ConfirmacaoConviteInstrutorDAO) ConfirmacaoConviteInstrutor(com.tomasio.projects.trainning.model.ConfirmacaoConviteInstrutor) 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 ConfirmacaoConviteInstrutorDAO

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

the class AtividadesEnsinoServiceSimpleImpl method createConfirmacaoConviteInstrutor.

@Override
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
@Transactional
public Long createConfirmacaoConviteInstrutor(ConfirmacaoConviteInstrutorDTO confirmacao) {
    ConfirmacaoConviteInstrutorDAO dao = factory.getConfirmacaoConviteInstrutorDAO();
    ConfirmacaoConviteInstrutor model = new ConfirmacaoConviteInstrutor(confirmacao);
    try {
        Long id = dao.create(model);
        return id;
    } catch (DAOException ex) {
        Logger.getLogger(AtividadesEnsinoServiceSimpleImpl.class.getName()).log(Level.SEVERE, null, ex);
        throw new CoreException(ex.getMessage());
    } catch (Exception ex) {
        Logger.getLogger(AtividadesEnsinoServiceSimpleImpl.class.getName()).log(Level.SEVERE, null, ex);
        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) ConfirmacaoConviteInstrutorDAO(com.tomasio.projects.trainning.dao.ConfirmacaoConviteInstrutorDAO) ConfirmacaoConviteInstrutor(com.tomasio.projects.trainning.model.ConfirmacaoConviteInstrutor) 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 ConfirmacaoConviteInstrutorDAO

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

the class AtividadesEnsinoServiceSimpleImpl method findAllConfirmacoesConvitesInstrutoresByTurmaId.

@Override
@Transactional(readOnly = true)
public ConfirmacaoConviteInstrutorDTO[] findAllConfirmacoesConvitesInstrutoresByTurmaId(Long turmaId) {
    ConfirmacaoConviteInstrutorDAO dao = factory.getConfirmacaoConviteInstrutorDAO();
    ConfirmacaoConviteInstrutorDTO[] confirmacoesArray;
    try {
        List<ConfirmacaoConviteInstrutor> itens = dao.findAllByTurmaId(turmaId);
        confirmacoesArray = new ConfirmacaoConviteInstrutorDTO[itens.size()];
        for (int i = 0; i < confirmacoesArray.length; i++) {
            confirmacoesArray[i] = itens.get(i).createDTO();
        }
        return confirmacoesArray;
    } 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) ConfirmacaoConviteInstrutorDTO(com.tomasio.projects.trainning.dto.ConfirmacaoConviteInstrutorDTO) CoreException(com.tomasio.projects.trainning.exeption.CoreException) ConfirmacaoConviteInstrutorDAO(com.tomasio.projects.trainning.dao.ConfirmacaoConviteInstrutorDAO) ConfirmacaoConviteInstrutor(com.tomasio.projects.trainning.model.ConfirmacaoConviteInstrutor) Transactional(org.springframework.transaction.annotation.Transactional)

Example 5 with ConfirmacaoConviteInstrutorDAO

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

the class AtividadesEnsinoServiceSimpleImpl method findAllConfirmacoesConvitesInstrutoresByPessoaId.

@Override
@Transactional(readOnly = true)
public ConfirmacaoConviteInstrutorDTO[] findAllConfirmacoesConvitesInstrutoresByPessoaId(Long pessoaId) {
    ConfirmacaoConviteInstrutorDAO dao = factory.getConfirmacaoConviteInstrutorDAO();
    ConfirmacaoConviteInstrutorDTO[] confirmacoesArray;
    try {
        List<ConfirmacaoConviteInstrutor> itens = dao.findAllByPessoaId(pessoaId);
        confirmacoesArray = new ConfirmacaoConviteInstrutorDTO[itens.size()];
        for (int i = 0; i < confirmacoesArray.length; i++) {
            confirmacoesArray[i] = itens.get(i).createDTO();
        }
        return confirmacoesArray;
    } 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) ConfirmacaoConviteInstrutorDTO(com.tomasio.projects.trainning.dto.ConfirmacaoConviteInstrutorDTO) CoreException(com.tomasio.projects.trainning.exeption.CoreException) ConfirmacaoConviteInstrutorDAO(com.tomasio.projects.trainning.dao.ConfirmacaoConviteInstrutorDAO) ConfirmacaoConviteInstrutor(com.tomasio.projects.trainning.model.ConfirmacaoConviteInstrutor) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

ConfirmacaoConviteInstrutorDAO (com.tomasio.projects.trainning.dao.ConfirmacaoConviteInstrutorDAO)6 DAOException (com.tomasio.projects.trainning.exception.DAOException)6 CoreException (com.tomasio.projects.trainning.exeption.CoreException)6 ConfirmacaoConviteInstrutor (com.tomasio.projects.trainning.model.ConfirmacaoConviteInstrutor)6 Transactional (org.springframework.transaction.annotation.Transactional)6 ConfirmacaoConviteInstrutorDTO (com.tomasio.projects.trainning.dto.ConfirmacaoConviteInstrutorDTO)3 ParseException (java.text.ParseException)3