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

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

php - facebook and github login HWIOAuthBundle and FOSUserBundle in Symfony2.1 -

hadoop - Sqoop installation export and import from postgresql -