Search in sources :

Example 1 with ItemConviteInstrutorIndividual

use of com.tomasio.projects.trainning.model.ItemConviteInstrutorIndividual in project trainning by fernandotomasio.

the class AtividadesEnsinoServiceSimpleImpl method findAllItensConviteInstrutorIndividualByConviteInstrutorIndividualId.

@Override
@Transactional(readOnly = true)
public ItemConviteInstrutorIndividualDTO[] findAllItensConviteInstrutorIndividualByConviteInstrutorIndividualId(Long conviteId) {
    ItemConviteInstrutorIndividualDAO dao = factory.getItemConviteInstrutorIndividualDAO();
    ItemConviteInstrutorIndividualDTO[] itensConviteArray;
    try {
        List<ItemConviteInstrutorIndividual> itens = dao.findAllByConviteId(conviteId);
        itensConviteArray = new ItemConviteInstrutorIndividualDTO[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 : ItemConviteInstrutorIndividual(com.tomasio.projects.trainning.model.ItemConviteInstrutorIndividual) DAOException(com.tomasio.projects.trainning.exception.DAOException) ItemConviteInstrutorIndividualDTO(com.tomasio.projects.trainning.dto.ItemConviteInstrutorIndividualDTO) CoreException(com.tomasio.projects.trainning.exeption.CoreException) ItemConviteInstrutorIndividualDAO(com.tomasio.projects.trainning.dao.ItemConviteInstrutorIndividualDAO) Transactional(org.springframework.transaction.annotation.Transactional)

Example 2 with ItemConviteInstrutorIndividual

use of com.tomasio.projects.trainning.model.ItemConviteInstrutorIndividual in project trainning by fernandotomasio.

the class AtividadesEnsinoServiceSimpleImpl method updateItemConviteInstrutorIndividual.

@Override
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
@Transactional
public void updateItemConviteInstrutorIndividual(ItemConviteInstrutorIndividualDTO itemConvite) {
    ItemConviteInstrutorIndividualDAO dao = factory.getItemConviteInstrutorIndividualDAO();
    ItemConviteInstrutorIndividual model = new ItemConviteInstrutorIndividual(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 : ItemConviteInstrutorIndividual(com.tomasio.projects.trainning.model.ItemConviteInstrutorIndividual) DAOException(com.tomasio.projects.trainning.exception.DAOException) CoreException(com.tomasio.projects.trainning.exeption.CoreException) ItemConviteInstrutorIndividualDAO(com.tomasio.projects.trainning.dao.ItemConviteInstrutorIndividualDAO) 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 ItemConviteInstrutorIndividual

use of com.tomasio.projects.trainning.model.ItemConviteInstrutorIndividual in project trainning by fernandotomasio.

the class HibernateItemConviteInstrutorIndividualDAO method remove.

@Override
public void remove(Long id) throws DAOException {
    Session session = sessionFactory.getCurrentSession();
    try {
        ItemConviteInstrutorIndividual itemConvite = (ItemConviteInstrutorIndividual) session.get(ItemConviteInstrutorIndividual.class, id);
        session.delete(itemConvite);
    } catch (HibernateException e) {
        Logger.getLogger(HibernateItemConviteInstrutorIndividualDAO.class.getName()).log(Level.SEVERE, null, e);
        throw new DAOException(MessageHelper.getMessage("consultas.remove.error"));
    }
}
Also used : ItemConviteInstrutorIndividual(com.tomasio.projects.trainning.model.ItemConviteInstrutorIndividual) DAOException(com.tomasio.projects.trainning.exception.DAOException)

Example 4 with ItemConviteInstrutorIndividual

use of com.tomasio.projects.trainning.model.ItemConviteInstrutorIndividual in project trainning by fernandotomasio.

the class AtividadesEnsinoServiceSimpleImpl method findAllItensConviteInstrutorIndividualByTurmaId.

@Override
@Transactional(readOnly = true)
public ItemConviteInstrutorIndividualDTO[] findAllItensConviteInstrutorIndividualByTurmaId(Long turmaId) {
    ItemConviteInstrutorIndividualDAO dao = factory.getItemConviteInstrutorIndividualDAO();
    ItemConviteInstrutorIndividualDTO[] itensConviteArray;
    try {
        List<ItemConviteInstrutorIndividual> itens = dao.findAllByTurmaId(turmaId);
        itensConviteArray = new ItemConviteInstrutorIndividualDTO[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 : ItemConviteInstrutorIndividual(com.tomasio.projects.trainning.model.ItemConviteInstrutorIndividual) DAOException(com.tomasio.projects.trainning.exception.DAOException) ItemConviteInstrutorIndividualDTO(com.tomasio.projects.trainning.dto.ItemConviteInstrutorIndividualDTO) CoreException(com.tomasio.projects.trainning.exeption.CoreException) ItemConviteInstrutorIndividualDAO(com.tomasio.projects.trainning.dao.ItemConviteInstrutorIndividualDAO) Transactional(org.springframework.transaction.annotation.Transactional)

Example 5 with ItemConviteInstrutorIndividual

use of com.tomasio.projects.trainning.model.ItemConviteInstrutorIndividual in project trainning by fernandotomasio.

the class AtividadesEnsinoServiceSimpleImpl method findAllItensConviteInstrutorIndividualByPessoaId.

@Override
@Transactional(readOnly = true)
public ItemConviteInstrutorIndividualDTO[] findAllItensConviteInstrutorIndividualByPessoaId(Long pessoaId) {
    ItemConviteInstrutorIndividualDAO dao = factory.getItemConviteInstrutorIndividualDAO();
    ItemConviteInstrutorIndividualDTO[] itensConviteArray;
    try {
        List<ItemConviteInstrutorIndividual> itens = dao.findAllByPessoaId(pessoaId);
        itensConviteArray = new ItemConviteInstrutorIndividualDTO[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 : ItemConviteInstrutorIndividual(com.tomasio.projects.trainning.model.ItemConviteInstrutorIndividual) DAOException(com.tomasio.projects.trainning.exception.DAOException) ItemConviteInstrutorIndividualDTO(com.tomasio.projects.trainning.dto.ItemConviteInstrutorIndividualDTO) CoreException(com.tomasio.projects.trainning.exeption.CoreException) ItemConviteInstrutorIndividualDAO(com.tomasio.projects.trainning.dao.ItemConviteInstrutorIndividualDAO) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

DAOException (com.tomasio.projects.trainning.exception.DAOException)7 ItemConviteInstrutorIndividual (com.tomasio.projects.trainning.model.ItemConviteInstrutorIndividual)7 ItemConviteInstrutorIndividualDAO (com.tomasio.projects.trainning.dao.ItemConviteInstrutorIndividualDAO)6 CoreException (com.tomasio.projects.trainning.exeption.CoreException)6 Transactional (org.springframework.transaction.annotation.Transactional)6 ItemConviteInstrutorIndividualDTO (com.tomasio.projects.trainning.dto.ItemConviteInstrutorIndividualDTO)3 ParseException (java.text.ParseException)3