Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 86852 invoked from network); 17 May 2006 21:31:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 17 May 2006 21:31:09 -0000 Received: (qmail 389 invoked by uid 500); 17 May 2006 21:30:59 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 328 invoked by uid 500); 17 May 2006 21:30:59 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 197 invoked by uid 99); 17 May 2006 21:30:59 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 May 2006 14:30:58 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [129.55.12.40] (HELO ll.mit.edu) (129.55.12.40) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 May 2006 14:30:58 -0700 Received: (from smtp@localhost) by ll.mit.edu (8.12.10/8.8.8) id k4HLUaqN017231 for ; Wed, 17 May 2006 17:30:36 -0400 (EDT) Received: from UNKNOWN( ), claiming to be "[155.34.198.75]" via SMTP by llmail, id smtpdAAA_OaixH; Wed May 17 17:30:30 2006 Message-ID: <446B95F6.8090008@ll.mit.edu> Date: Wed, 17 May 2006 17:30:30 -0400 From: Vadim Grinshpun User-Agent: Thunderbird 1.5.0.2 (X11/20060501) MIME-Version: 1.0 To: user-java@ibatis.apache.org Subject: reading nullable columns via iBATIS SqlMap Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N 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