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