Search in sources :

Example 1 with ItemConviteInstrutorPerfilDAO

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

the class AtividadesEnsinoServiceSimpleImpl method updateItemConviteInstrutorPerfil.

@Override
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
@Transactional
public void updateItemConviteInstrutorPerfil(ItemConviteInstrutorPerfilDTO itemConvite) {
    ItemConviteInstrutorPerfilDAO dao = factory.getItemConviteInstrutorPerfilDAO();
    ItemConviteInstrutorPerfil model = new ItemConviteInstrutorPerfil(itemConvite);
    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) ItemConviteInstrutorPerfil(com.tomasio.projects.trainning.model.ItemConviteInstrutorPerfil) ItemConviteInstrutorPerfilDAO(com.tomasio.projects.trainning.dao.ItemConviteInstrutorPerfilDAO) 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 ItemConviteInstrutorPerfilDAO

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

the class AtividadesEnsinoServiceSimpleImpl method createItemConviteInstrutorPerfil.

@Override
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
@Transactional
public Long createItemConviteInstrutorPerfil(ItemConviteInstrutorPerfilDTO itemConvite) {
    ItemConviteInstrutorPerfilDAO dao = factory.getItemConviteInstrutorPerfilDAO();
    ItemConviteInstrutorPerfil model = new ItemConviteInstrutorPerfil(itemConvite);
    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) ItemConviteInstrutorPerfil(com.tomasio.projects.trainning.model.ItemConviteInstrutorPerfil) ItemConviteInstrutorPerfilDAO(com.tomasio.projects.trainning.dao.ItemConviteInstrutorPerfilDAO) 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 ItemConviteInstrutorPerfilDAO

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

the class AtividadesEnsinoServiceSimpleImpl method findItemConviteInstrutorPerfil.

@Override
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
@Transactional(readOnly = true)
public ItemConviteInstrutorPerfilDTO findItemConviteInstrutorPerfil(Long itemConviteId) {
    ItemConviteInstrutorPerfilDAO dao = factory.getItemConviteInstrutorPerfilDAO();
    ItemConviteInstrutorPerfil itemConvite = null;
    try {
        itemConvite = dao.find(itemConviteId);
    } 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 (itemConvite != null) {
        return itemConvite.createDTO();
    } else {
        return null;
    }
}
Also used : DAOException(com.tomasio.projects.trainning.exception.DAOException) CoreException(com.tomasio.projects.trainning.exeption.CoreException) ItemConviteInstrutorPerfil(com.tomasio.projects.trainning.model.ItemConviteInstrutorPerfil) ItemConviteInstrutorPerfilDAO(com.tomasio.projects.trainning.dao.ItemConviteInstrutorPerfilDAO) 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 ItemConviteInstrutorPerfilDAO

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

the class AtividadesEnsinoServiceSimpleImpl method findAllItensConviteInstrutorPerfilByTurmaId.

@Override
@Transactional(readOnly = true)
public ItemConviteInstrutorPerfilDTO[] findAllItensConviteInstrutorPerfilByTurmaId(Long turmaId) {
    ItemConviteInstrutorPerfilDAO dao = factory.getItemConviteInstrutorPerfilDAO();
    ItemConviteInstrutorPerfilDTO[] itensConviteArray;
    try {
        List<ItemConviteInstrutorPerfil> itens = dao.findAllByTurmaId(turmaId);
        itensConviteArray = new ItemConviteInstrutorPerfilDTO[itens.size()];
        for (int i = 0; i < itensConviteArray.length; i++) {
            itensConviteArray[i] = itens.get(i).createDTO();
        }
        return itensConviteArray;
    } 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) ItemConviteInstrutorPerfil(com.tomasio.projects.trainning.model.ItemConviteInstrutorPerfil) ItemConviteInstrutorPerfilDAO(com.tomasio.projects.trainning.dao.ItemConviteInstrutorPerfilDAO) ItemConviteInstrutorPerfilDTO(com.tomasio.projects.trainning.dto.ItemConviteInstrutorPerfilDTO) Transactional(org.springframework.transaction.annotation.Transactional)

Example 5 with ItemConviteInstrutorPerfilDAO

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

the class AtividadesEnsinoServiceSimpleImpl method findAllItensConviteInstrutorPerfilByConviteInstrutorPerfilId.

@Override
@Transactional(readOnly = true)
public ItemConviteInstrutorPerfilDTO[] findAllItensConviteInstrutorPerfilByConviteInstrutorPerfilId(Long convite) {
    ItemConviteInstrutorPerfilDAO dao = factory.getItemConviteInstrutorPerfilDAO();
    ItemConviteInstrutorPerfilDTO[] itensConviteArray;
    try {
        List<ItemConviteInstrutorPerfil> itens = dao.findAllByConviteId(convite);
        itensConviteArray = new ItemConviteInstrutorPerfilDTO[itens.size()];
        for (int i = 0; i < itensConviteArray.length; i++) {
            itensConviteArray[i] = itens.get(i).createDTO();
        }
        return itensConviteArray;
    } 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) ItemConviteInstrutorPerfil(com.tomasio.projects.trainning.model.ItemConviteInstrutorPerfil) ItemConviteInstrutorPerfilDAO(com.tomasio.projects.trainning.dao.ItemConviteInstrutorPerfilDAO) ItemConviteInstrutorPerfilDTO(com.tomasio.projects.trainning.dto.ItemConviteInstrutorPerfilDTO) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

ItemConviteInstrutorPerfilDAO (com.tomasio.projects.trainning.dao.ItemConviteInstrutorPerfilDAO)5 DAOException (com.tomasio.projects.trainning.exception.DAOException)5 CoreException (com.tomasio.projects.trainning.exeption.CoreException)5 ItemConviteInstrutorPerfil (com.tomasio.projects.trainning.model.ItemConviteInstrutorPerfil)5 Transactional (org.springframework.transaction.annotation.Transactional)5 ParseException (java.text.ParseException)3 ItemConviteInstrutorPerfilDTO (com.tomasio.projects.trainning.dto.ItemConviteInstrutorPerfilDTO)2