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
Post a Comment