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());
}
}
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());
}
}
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"));
}
}
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());
}
}
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());
}
}
Aggregations