use of com.tomasio.projects.trainning.model.Anotacao in project trainning by fernandotomasio.
the class HibernateAnotacaoDAO method create.
@Override
public Long create(AnotacaoDTO anotacao) throws DAOException {
Session session = sessionFactory.getCurrentSession();
try {
Anotacao _anotacao = new Anotacao(anotacao);
Long anotacaoId = (Long) session.save(_anotacao);
return anotacaoId;
} catch (HibernateException e) {
Logger.getLogger(HibernateAnotacaoDAO.class.getName()).log(Level.SEVERE, null, e);
throw new DAOException(MessageHelper.getMessage("anotacoes.create.error"));
}
}
Aggregations