ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vadim Grinshpun <va...@ll.mit.edu>
Subject reading nullable columns via iBATIS SqlMap
Date Wed, 17 May 2006 21:30:30 GMT
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

Mime
View raw message