use of com.tomasio.projects.trainning.exeption.CoreException in project trainning by fernandotomasio.
the class TrainningServiceSimpleImpl method searchCurso.
@Override
@Transactional(readOnly = true)
public CursoDTO[] searchCurso(String searchTerm, Long planoId, Long areaId, Boolean ativo, Boolean permiteEstrangeiro) {
CursoDAO dao = factory.getCursoDAO();
CursoDTO[] cursosArray = null;
try {
List<Curso> cursos = dao.search(searchTerm, planoId, areaId, ativo, permiteEstrangeiro);
if (cursos != null) {
cursosArray = new CursoDTO[cursos.size()];
for (int i = 0; i < cursos.size(); i++) {
cursosArray[i] = cursos.get(i).createDTOWithoutDependencies();
}
}
} catch (DAOException ex) {
throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
}
return cursosArray;
}
use of com.tomasio.projects.trainning.exeption.CoreException 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.exeption.CoreException in project trainning by fernandotomasio.
the class TrainningServiceSimpleImpl method findArea.
@Override
@Transactional(readOnly = true)
public AreaDTO findArea(Long id) {
AreaDAO dao = factory.getAreaDAO();
Area area = null;
try {
area = dao.find(id);
} catch (DAOException ex) {
throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
}
if (!(area == null)) {
return area.createDTO();
} else {
return null;
}
}
use of com.tomasio.projects.trainning.exeption.CoreException in project trainning by fernandotomasio.
the class TrainningServiceSimpleImpl method findCursoByCodigo.
@Override
@Transactional(readOnly = true)
public CursoDTO findCursoByCodigo(String codigo) {
CursoDAO dao = factory.getCursoDAO();
Curso curso = null;
try {
curso = dao.findByCodigo(codigo);
} catch (DAOException ex) {
throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
}
if (curso != null) {
return curso.createDTO();
} else {
return null;
}
}
use of com.tomasio.projects.trainning.exeption.CoreException in project trainning by fernandotomasio.
the class TrainningServiceSimpleImpl method findCurso.
@Override
@Transactional(readOnly = true)
public CursoDTO findCurso(Long id) {
CursoDAO dao = factory.getCursoDAO();
Curso curso = null;
try {
curso = dao.find(id);
} catch (DAOException ex) {
throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
}
if (curso != null) {
return curso.createDTO();
} else {
return null;
}
}
Aggregations