use of com.tomasio.projects.trainning.model.CurriculoMinimo in project trainning by fernandotomasio.
the class TeachingDocumentsServiceSimpleImpl method findAllCurriculosMinimos.
@Override
@Transactional(readOnly = true)
public CurriculoMinimoDTO[] findAllCurriculosMinimos() {
CurriculoMinimoDAO dao = factory.getCurriculoMinimoDAO();
CurriculoMinimoDTO[] curriculosArray = null;
try {
List<CurriculoMinimo> curriculos = dao.findAllCurriculosMinimos();
if (curriculos != null) {
curriculosArray = new CurriculoMinimoDTO[curriculos.size()];
for (int i = 0; i < curriculos.size(); i++) {
curriculosArray[i] = curriculos.get(i).createDTO();
}
}
} catch (DAOException ex) {
throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
}
return curriculosArray;
}
use of com.tomasio.projects.trainning.model.CurriculoMinimo in project trainning by fernandotomasio.
the class TeachingDocumentsServiceSimpleImpl method createCurriculoMinimo.
@Override
@Transactional
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
public Long createCurriculoMinimo(CurriculoMinimoDTO curriculo) {
CurriculoMinimoDAO dao = factory.getCurriculoMinimoDAO();
CurriculoMinimo model = new CurriculoMinimo(curriculo);
Long id = null;
try {
id = dao.create(model);
} catch (DAOException ex) {
throw new CoreException(ex.getMessage());
} catch (Exception ex) {
throw new CoreException("Erro de sistema: " + ex.getMessage());
}
return id;
}
use of com.tomasio.projects.trainning.model.CurriculoMinimo in project trainning by fernandotomasio.
the class TeachingDocumentsServiceSimpleImpl method updateCurriculoMinimo.
@Override
@Transactional
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
public void updateCurriculoMinimo(CurriculoMinimoDTO curriculo) {
CurriculoMinimoDAO dao = factory.getCurriculoMinimoDAO();
CurriculoMinimo model = new CurriculoMinimo(curriculo);
try {
dao.update(model);
} catch (DAOException ex) {
throw new CoreException(ex.getMessage());
} catch (Exception ex) {
throw new CoreException("Erro de sistema: " + ex.getMessage());
}
}
use of com.tomasio.projects.trainning.model.CurriculoMinimo in project trainning by fernandotomasio.
the class HibernateCurriculoMinimoDAO method remove.
@Override
public void remove(Long id) throws DAOException {
Session session = sessionFactory.getCurrentSession();
try {
CurriculoMinimo curriculo = (CurriculoMinimo) session.get(CurriculoMinimo.class, id);
session.delete(curriculo);
} catch (HibernateException e) {
Logger.getLogger(HibernateCursoDAO.class.getName()).log(Level.SEVERE, null, e);
throw new DAOException(MessageHelper.getMessage("curriculos.update.error"));
}
}
use of com.tomasio.projects.trainning.model.CurriculoMinimo in project trainning by fernandotomasio.
the class TeachingDocumentsServiceSimpleImpl method findCurriculoMinimo.
@Override
@Transactional(readOnly = true)
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
public CurriculoMinimoDTO findCurriculoMinimo(Long curriculoId) {
CurriculoMinimoDAO dao = factory.getCurriculoMinimoDAO();
CurriculoMinimo curriculo = null;
try {
curriculo = dao.find(curriculoId);
} catch (DAOException ex) {
throw new CoreException(ex.getMessage());
} catch (Exception ex) {
throw new CoreException("Erro de sistema: " + ex.getMessage());
}
if (curriculo != null) {
return curriculo.createDTO();
} else {
return null;
}
}
Aggregations