use of com.tomasio.projects.trainning.dao.PlanoDAO in project trainning by fernandotomasio.
the class TrainningServiceSimpleImpl method updatePlano.
@Override
@Transactional
public void updatePlano(PlanoDTO planoDTO) {
PlanoDAO dao = factory.getPlanoDAO();
Plano model = new Plano();
assemblyEntity(planoDTO, model);
try {
dao.update(model);
} catch (DAOException ex) {
throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
}
}
use of com.tomasio.projects.trainning.dao.PlanoDAO in project trainning by fernandotomasio.
the class TrainningServiceSimpleImpl method createPlano.
@Override
@Transactional
public Long createPlano(PlanoDTO plano) {
PlanoDAO dao = factory.getPlanoDAO();
Plano model = new Plano();
assemblyEntity(plano, model);
return create(dao, model);
}
use of com.tomasio.projects.trainning.dao.PlanoDAO in project trainning by fernandotomasio.
the class TrainningServiceSimpleImpl method removePlano.
@Override
@Transactional
public void removePlano(Long id) {
PlanoDAO dao = factory.getPlanoDAO();
remove(dao, id);
}
use of com.tomasio.projects.trainning.dao.PlanoDAO in project trainning by fernandotomasio.
the class AtividadesEnsinoServiceSimpleImpl method findAllPlanos.
@Override
@Transactional(readOnly = true)
public PlanoDTO[] findAllPlanos() {
PlanoDAO dao = factory.getPlanoDAO();
List<Plano> planos;
PlanoDTO[] planosArray = null;
try {
planos = dao.findAll();
planosArray = new PlanoDTO[planos.size()];
for (int i = 0; i < planos.size(); i++) {
planosArray[i] = planos.get(i).createDTOWithoutDependencies();
}
return planosArray;
} catch (DAOException ex) {
ex.printStackTrace();
throw new CoreException(ex.getMessage());
} catch (Exception ex) {
ex.printStackTrace();
throw new CoreException(ex.getMessage());
}
}
use of com.tomasio.projects.trainning.dao.PlanoDAO in project trainning by fernandotomasio.
the class AtividadesEnsinoServiceSimpleImpl method findAllOrganizacoesHasPlano.
@Override
@Transactional(readOnly = true)
public OrganizacaoDTO[] findAllOrganizacoesHasPlano() {
PlanoDAO dao = factory.getPlanoDAO();
List<OrganizacaoDTO> organizacoes;
OrganizacaoDTO[] organizacoesArray = null;
try {
organizacoes = dao.findAllOrganizacoesHasPlano();
organizacoesArray = new OrganizacaoDTO[organizacoes.size()];
for (int i = 0; i < organizacoes.size(); i++) {
organizacoesArray[i] = organizacoes.get(i);
}
return organizacoesArray;
} catch (DAOException ex) {
ex.printStackTrace();
throw new CoreException(ex.getMessage());
} catch (Exception ex) {
ex.printStackTrace();
throw new CoreException(ex.getMessage());
}
}
Aggregations