use of com.tomasio.projects.trainning.exception.DAOException 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.exception.DAOException 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.exception.DAOException 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.exception.DAOException 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;
}
}
use of com.tomasio.projects.trainning.exception.DAOException in project trainning by fernandotomasio.
the class TrainningServiceSimpleImpl method updateArea.
@Override
@Transactional
public void updateArea(AreaDTO area) {
AreaDAO dao = factory.getAreaDAO();
Area _area = new Area(area);
try {
dao.update(_area);
} catch (DAOException ex) {
throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
}
}
Aggregations