Search in sources :

Example 1 with ConviteInstrutorDAO

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

the class AtividadesEnsinoServiceSimpleImpl method removeConviteInstrutor.

@Override
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
@Transactional
public void removeConviteInstrutor(Long conviteId) {
    ConviteInstrutorDAO dao = factory.getConviteInstrutorDAO();
    remove(dao, conviteId);
}
Also used : ConviteInstrutorDAO(com.tomasio.projects.trainning.dao.ConviteInstrutorDAO) ConfirmacaoConviteInstrutorDAO(com.tomasio.projects.trainning.dao.ConfirmacaoConviteInstrutorDAO) Transactional(org.springframework.transaction.annotation.Transactional)

Example 2 with ConviteInstrutorDAO

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

the class AtividadesEnsinoServiceSimpleImpl method findConviteInstrutor.

@Override
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
@Transactional(readOnly = true)
public ConviteInstrutorDTO findConviteInstrutor(Long conviteId) {
    ConviteInstrutorDAO dao = factory.getConviteInstrutorDAO();
    ConviteInstrutor consulta = (ConviteInstrutor) find(dao, conviteId);
    if (consulta != null) {
        return (ConviteInstrutorDTO) consulta.createDTO();
    } else {
        return null;
    }
}
Also used : ConfirmacaoConviteInstrutor(com.tomasio.projects.trainning.model.ConfirmacaoConviteInstrutor) ConviteInstrutor(com.tomasio.projects.trainning.model.ConviteInstrutor) ConfirmacaoConviteInstrutorDTO(com.tomasio.projects.trainning.dto.ConfirmacaoConviteInstrutorDTO) ConviteInstrutorDTO(com.tomasio.projects.trainning.dto.ConviteInstrutorDTO) ConviteInstrutorDAO(com.tomasio.projects.trainning.dao.ConviteInstrutorDAO) ConfirmacaoConviteInstrutorDAO(com.tomasio.projects.trainning.dao.ConfirmacaoConviteInstrutorDAO) Transactional(org.springframework.transaction.annotation.Transactional)

Example 3 with ConviteInstrutorDAO

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

the class AtividadesEnsinoServiceSimpleImpl method findAllConvitesInstrutoresByOrganizacaoRemetenteId.

@Override
@Transactional(readOnly = true)
public ConviteInstrutorDTO[] findAllConvitesInstrutoresByOrganizacaoRemetenteId(Long organizacaoId, boolean finalizado) {
    ConviteInstrutorDAO dao = factory.getConviteInstrutorDAO();
    try {
        List<ConviteInstrutor> itens = dao.findAllByOrganizacaoRemetenteId(organizacaoId, finalizado);
        ConviteInstrutorDTO[] array = new ConviteInstrutorDTO[itens.size()];
        convertToArray(itens, array);
        return array;
    } 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) ConfirmacaoConviteInstrutor(com.tomasio.projects.trainning.model.ConfirmacaoConviteInstrutor) ConviteInstrutor(com.tomasio.projects.trainning.model.ConviteInstrutor) CoreException(com.tomasio.projects.trainning.exeption.CoreException) ConfirmacaoConviteInstrutorDTO(com.tomasio.projects.trainning.dto.ConfirmacaoConviteInstrutorDTO) ConviteInstrutorDTO(com.tomasio.projects.trainning.dto.ConviteInstrutorDTO) ConviteInstrutorDAO(com.tomasio.projects.trainning.dao.ConviteInstrutorDAO) ConfirmacaoConviteInstrutorDAO(com.tomasio.projects.trainning.dao.ConfirmacaoConviteInstrutorDAO) Transactional(org.springframework.transaction.annotation.Transactional)

Example 4 with ConviteInstrutorDAO

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

the class AtividadesEnsinoServiceSimpleImpl method findAllConvitesInstrutoresByTurmaId.

@Override
@Transactional(readOnly = true)
public ConviteInstrutorDTO[] findAllConvitesInstrutoresByTurmaId(Long turmaId, boolean finalizado) {
    ConviteInstrutorDAO dao = factory.getConviteInstrutorDAO();
    try {
        List<ConviteInstrutor> itens = dao.findAllByTurmaId(turmaId, finalizado);
        ConviteInstrutorDTO[] array = new ConviteInstrutorDTO[itens.size()];
        convertToArray(itens, array);
        return array;
    } 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) ConfirmacaoConviteInstrutor(com.tomasio.projects.trainning.model.ConfirmacaoConviteInstrutor) ConviteInstrutor(com.tomasio.projects.trainning.model.ConviteInstrutor) CoreException(com.tomasio.projects.trainning.exeption.CoreException) ConfirmacaoConviteInstrutorDTO(com.tomasio.projects.trainning.dto.ConfirmacaoConviteInstrutorDTO) ConviteInstrutorDTO(com.tomasio.projects.trainning.dto.ConviteInstrutorDTO) ConviteInstrutorDAO(com.tomasio.projects.trainning.dao.ConviteInstrutorDAO) ConfirmacaoConviteInstrutorDAO(com.tomasio.projects.trainning.dao.ConfirmacaoConviteInstrutorDAO) Transactional(org.springframework.transaction.annotation.Transactional)

Example 5 with ConviteInstrutorDAO

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

the class AtividadesEnsinoServiceSimpleImpl method createConviteInstrutor.

@Override
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
@Transactional
public Long createConviteInstrutor(ConviteInstrutorDTO convite) {
    ConviteInstrutorDAO dao = factory.getConviteInstrutorDAO();
    ConviteInstrutor model = null;
    if (convite instanceof ConviteInstrutorPerfilDTO) {
        model = new ConviteInstrutorPerfil((ConviteInstrutorPerfilDTO) convite);
    } else if (convite instanceof ConviteInstrutorIndividualDTO) {
        model = new ConviteInstrutorIndividual((ConviteInstrutorIndividualDTO) convite);
    }
    return create(dao, model);
}
Also used : ItemConviteInstrutorPerfil(com.tomasio.projects.trainning.model.ItemConviteInstrutorPerfil) ConviteInstrutorPerfil(com.tomasio.projects.trainning.model.ConviteInstrutorPerfil) ConfirmacaoConviteInstrutor(com.tomasio.projects.trainning.model.ConfirmacaoConviteInstrutor) ConviteInstrutor(com.tomasio.projects.trainning.model.ConviteInstrutor) ItemConviteInstrutorIndividualDTO(com.tomasio.projects.trainning.dto.ItemConviteInstrutorIndividualDTO) ConviteInstrutorIndividualDTO(com.tomasio.projects.trainning.dto.ConviteInstrutorIndividualDTO) ConviteInstrutorPerfilDTO(com.tomasio.projects.trainning.dto.ConviteInstrutorPerfilDTO) ItemConviteInstrutorPerfilDTO(com.tomasio.projects.trainning.dto.ItemConviteInstrutorPerfilDTO) ItemConviteInstrutorIndividual(com.tomasio.projects.trainning.model.ItemConviteInstrutorIndividual) ConviteInstrutorIndividual(com.tomasio.projects.trainning.model.ConviteInstrutorIndividual) ConviteInstrutorDAO(com.tomasio.projects.trainning.dao.ConviteInstrutorDAO) ConfirmacaoConviteInstrutorDAO(com.tomasio.projects.trainning.dao.ConfirmacaoConviteInstrutorDAO) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

ConfirmacaoConviteInstrutorDAO (com.tomasio.projects.trainning.dao.ConfirmacaoConviteInstrutorDAO)8 ConviteInstrutorDAO (com.tomasio.projects.trainning.dao.ConviteInstrutorDAO)8 Transactional (org.springframework.transaction.annotation.Transactional)8 ConfirmacaoConviteInstrutor (com.tomasio.projects.trainning.model.ConfirmacaoConviteInstrutor)7 ConviteInstrutor (com.tomasio.projects.trainning.model.ConviteInstrutor)7 ConfirmacaoConviteInstrutorDTO (com.tomasio.projects.trainning.dto.ConfirmacaoConviteInstrutorDTO)5 ConviteInstrutorDTO (com.tomasio.projects.trainning.dto.ConviteInstrutorDTO)5 DAOException (com.tomasio.projects.trainning.exception.DAOException)4 CoreException (com.tomasio.projects.trainning.exeption.CoreException)4 ConviteInstrutorIndividualDTO (com.tomasio.projects.trainning.dto.ConviteInstrutorIndividualDTO)2 ConviteInstrutorPerfilDTO (com.tomasio.projects.trainning.dto.ConviteInstrutorPerfilDTO)2 ItemConviteInstrutorIndividualDTO (com.tomasio.projects.trainning.dto.ItemConviteInstrutorIndividualDTO)2 ItemConviteInstrutorPerfilDTO (com.tomasio.projects.trainning.dto.ItemConviteInstrutorPerfilDTO)2 ConviteInstrutorIndividual (com.tomasio.projects.trainning.model.ConviteInstrutorIndividual)2 ConviteInstrutorPerfil (com.tomasio.projects.trainning.model.ConviteInstrutorPerfil)2 ItemConviteInstrutorIndividual (com.tomasio.projects.trainning.model.ItemConviteInstrutorIndividual)2 ItemConviteInstrutorPerfil (com.tomasio.projects.trainning.model.ItemConviteInstrutorPerfil)2