You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Wiyanto Ngasinur <wn...@gmail.com> on 2007/05/09 12:30:33 UTC

[S2] dynamic update in hibernate ?

hi, i've some form in struts 2 doing update with hibernate ?
i've add some attribute that need updated in form but not all attribute
in table i put in the form.

when i do update, it get error null exception.
i don't understand why hibernate trying to set null the attribute that i
don't put it in form. how do i avoid hibernate setting null to this
attribute ?  i've already set dynamic-update="true" in mapping files.


thanks


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] dynamic update in hibernate ?

Posted by Laurie Harper <la...@holoweb.net>.
Wiyanto Ngasinur wrote:
> hi, i've some form in struts 2 doing update with hibernate ?
> i've add some attribute that need updated in form but not all attribute
> in table i put in the form.
> 
> when i do update, it get error null exception.
> i don't understand why hibernate trying to set null the attribute that i
> don't put it in form. how do i avoid hibernate setting null to this
> attribute ?  i've already set dynamic-update="true" in mapping files.

It sounds like a problem with the way you're mapping the form data back 
into your persistent object. Without more details of exactly what you're 
doing, it's impossible to say what the problem is but it sounds like 
you're (re)setting properties on your persistent object that you 
shouldn't be.

L.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org