java - why hibernate no update field? -


i'm updating field in hibernate oracle database, doesn't. why hibernate doesn't update field leido?

    if (mensajeid.getleido().equals("false")) {          transaction tx = main.getsesion().begintransaction();         mensajeid.setleido("true");         mensaje mensaje = listamensajesrecibidos.getselectedvalue();         mensaje.setid(mensajeid);         mensaje.setusuariobyemisor(mensaje.getusuariobyemisor());         mensaje.setusuariobyreceptor(mensaje.getusuariobyreceptor());         main.getsesion().update(mensaje);                    tx.commit();     } 

it seems try use update() method not managed instance. should use saveorupdate() or save() in case.

if think entity in db instance not connected session should use merge() before.


Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -