ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Munat <b...@munat.com>
Subject Re: inserting null
Date Fri, 14 Jul 2006 16:07:41 GMT
Hmm, that's what I would have thought, but my co-worker was getting a null pointer when he

tried to do that. Might this be because the property is an Integer and something is 
calling intValue on it?

He changed his getter to return -1 instead of null, and configured the sqlmap to insert 
null for that and it works. I just thought I'd ask here because I'm sure I'll have a 
situation at some point where I want the property getter to return null elsewhere.

b

Larry Meadors wrote:
> That is the default behavior.
> 
> Larry
> 
> 
> On 7/13/06, Ben Munat <bent@munat.com> wrote:
> 
>> I see in the user's manual how one can tell ibatis to interpret a 
>> given property value as
>> meaning it should insert null into the column... like an int value of 
>> -9999 means insert null.
>>
>> What I don't see, however, is how to tell ibatis that a null value for 
>> a property means
>> insert a null. So, for example if I mapped someNum on my bean to the 
>> some_num column in my
>> table, and the getSomeNum method returned null, I want ibatis to 
>> insert null into
>> some_num. Is this even possible?
>>
>> b
>>

Mime
View raw message