No, the type in question is a String, which is quite nullable--hence my
surprise that this doesn't work as I'd expect.
(I ran into the int vs Integer issue previously, but a search of the mailing
list archive helped solve that :)
-Vadim
-----------------------------
Christian Poitras wrote:
Are you trying to put a null into a non-nullable type like int or
double?
If this is the case, you must use the object equivalent: Integer,
Double, etc...
-----Original Message-----
From: Vadim Grinshpun [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 17 May 2006 17:31
To: [email protected]
Subject: reading nullable columns via iBATIS SqlMap
Hi all,
I'm attempting to read in data from a small table with some nullable
columns into a bean that contains corresponding properties.
Everything works fine if no nulls are present in the table. The only way
I could get it to work with nulls was to write a result map with
"nullValue" attributes specified for all nullable columns. If I omit the
nullValue attribute, or if I use inline parameters instead of a result
map, a NullPointerException is thrown by iBATIS code. Is this the
expected behavior?
I was hoping that a column with a null value would be translated into a
Java null and would simply leave the bean's property set to null.
Specifying nullValue means that the property always gets set to some
non-null value, which is not exactly what I want.
Any help would be greatly appreciated!
FYI: I am using the latest iBATIS release (2.1.7). I have no easy way of
getting the exception stack trace to the machine I'm emailing from, but
if it is needed, let me know, I can try to outline the trace a bit.
Again, thanks.
-Vadim Grinshpun