Hello to everybody!!I'm not getting to delete:
Code:
public void apaga (Estoque estoque){
try{
Session sessao = HibernateUtil.getSession();
sessao.beginTransaction();
sessao.delete(estoque);
sessao.flush();
HibernateUtil.commitTransaction();
}catch (HibernateException ex){ex.printStackTrace();}
The only thing that happens is that the values become null, only the id keep the value!!!
The other part where I try to delete the object!!
Code:
Estoque estoq = new Estoque();
EstoqueDAO estoqDao = new EstoqueDAO();
estoq.setId(new Long (2));
estoqDao.apaga(estoq);