You guys have to understand that this is a tough call for us. It's just such a horrible implicit behaviour that I can't even imagine the concequences of it.
This falls into the category of: "Feature to support bad design choices."
Regardless of whether you have control over the database or not, you seem to have control over two other things:
1) The JavaBean design - You can solve the problem by using Integer instead of int (a good design choice).
I'm going a bit OT here, but I'm really interested in this point. I'm not exactly a very experienced java programmer but I've never liked to use Integer. Is it really the better design choice ? and why ? Is it the null thing or is because it makes everything more consistent in terms of being objects.
- OR -
2) The SQL Maps - You can solve the problem by specifying nullValue attribute of the result mapping (an explicit behaviour and a good design choice).
I guess explicit is always better, but I'm a lazy programmer sometimes ;-) that's one of the reasons why i use SQL Maps, it does so much for me automatically (if not automagically).
Regards,
Huy