I have on a screen a process table and I want to delete one of them. This is a piece of my datatable :
<p:column headerText="Excluir" style="width:68px">
<p:commandButton actionListener="#{processoMB.excluir(obj)}"
icon="ui-icon-trash" title="Excluir" styleClass="btn btn-block"
update=":frmTabela :dlgInformacao" alt="Excluir">
<p:confirm header="Confirmação" message="Deseja excluir?" />
</p:commandButton>
</p:column>
This is my delete method (Process Process) :
public void excluir(Processo processo) {
try {
daoProcesso.remover(processo);
ExibirMensagem.exibirMensagem(Mensagem.SUCESSO);
operacoesDeAlteracao();
} catch (Exception e) {
ExibirMensagem.exibirMensagem(Mensagem.ERRO);
e.printStackTrace();
}
}
And this is my remove (Object T) method in GenericDAO
public void remover(T objeto) {
Object o = manager.merge(objeto);
manager.remove(o);
}
When I click the button to delete a process Hibernate does only these operations and does not delete my process object:
Hibernate: select processo0_.id_processo as id_proce1_0_0_, processo0_.descricao as descrica2_0_0_ from tab_processo processo0_ where processo0_.id_processo=?
Hibernate: select processo0_.id_processo as id_proce1_0_, processo0_.descricao as descrica2_0_ from tab_processo processo0_ where id_processo<>0
What am I doing wrong?