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 Rick Reumann <ri...@gmail.com> on 2006/05/18 02:33:50 UTC

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

 <result property="displayOnline"
column="displayOnlineFlag"  javaType="boolean" nullValue="true"/>

and also tried nullValue="Y"  and tried adding jdbcType="VARCHAR"

Any ideas what I need to do to get the null value working with my
handler (other than altering the handler's code)?

-- 
Rick