Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 25883 invoked from network); 18 May 2006 06:56:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 18 May 2006 06:56:44 -0000 Received: (qmail 39933 invoked by uid 500); 18 May 2006 06:56:42 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 39909 invoked by uid 500); 18 May 2006 06:56:41 -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 39898 invoked by uid 99); 18 May 2006 06:56:41 -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 23:56:41 -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 [83.247.21.91] (HELO wis.nl) (83.247.21.91) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 May 2006 23:56:41 -0700 Content-class: urn:content-classes:message Subject: RE: I have a TypeHandler that converts Y/N to boolean, but sometimes Y/N might be null... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Thu, 18 May 2006 08:55:52 +0200 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Message-ID: <50CA25BD6EEA954FA592C097399942E30E4641A9@CM1.wis.local> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: I have a TypeHandler that converts Y/N to boolean, but sometimes Y/N might be null... thread-index: AcZ6EsYCj9cEfO7zRDK+u6xJWL3w3gANPpSA From: "Niels Beekman" To: X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N I think your typehandler.valueOf() implementation is incorrect. The string passed to it is the string you specified in the attribute "nullValue". You should do something like: public Object valueOf(String s) { return "Y".equals(s); } Niels -----Original Message----- From: Rick Reumann [mailto:rickcr@gmail.com]=20 Sent: donderdag 18 mei 2006 2:34 To: user-java@ibatis.apache.org Subject: I have a TypeHandler that converts Y/N to boolean, but sometimes Y/N might be null... My boolean TypeHander for columns in the database that are Y or N is working great (thanks Nathan). The problem now, however, is that I have an outer join that joins on that table with the Y/N varchar column will sometimes be null. I'm using the type handler globally (defined in sqlMap config). The problem is on these null columns I want the boolean value to be "true" but I'm having difficulty setting it up. I've tried various settings for the nullValue on the resultMap for these boolean fields, but I still end up getting an error like: --- The error occurred while applying a result map. --- Check the Subscriptions.subscriptionsMap. --- The error happened while setting a property on the result object. --- Cause: com.ibatis.common.beans.ProbeException: Could not set property 'subscribedToEmail' for com.nielsenmedia.npn.v o.Subscription. Cause: java.lang.IllegalArgumentException: argument type mismatch Caused by: java.lang.IllegalArgumentException: argument type mismatch Caused by: com.ibatis.common.beans.ProbeException: Could not set property 'subscribedToEmail' for com.npn.v o.Subscription. Cause: java.lang.IllegalArgumentException: argument type mismatch Caused by: java.lang.IllegalArgumentException: argument type mismatch I've tried and also tried nullValue=3D"Y" and tried adding jdbcType=3D"VARCHAR" Any ideas what I need to do to get the null value working with my handler (other than altering the handler's code)? --=20 Rick