You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Vadim Grinshpun <va...@ll.mit.edu> on 2006/05/17 23:30:30 UTC
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