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 topgd <ro...@yahoo.com> on 2008/01/10 02:28:09 UTC

nullValue for Boolean wrapper class property

I am using a TypeHandlerCallback to map a Boolean property to a DB2
character(1) field that contains 'T' or 'F'.  

I cannot get the nullValue property to return the value "F" when the
database field value is NULL.  The exception is:

    java.sql.SQLException: Unexpected value null found where T or F was
expected.

Neither of these work:
  <result property="cardRequested" column="dp_card" nullValue="F"/>
  <result property="cardRequested" column="dp_card" javaType="Boolean"
jdbcType="CHARACTER" nullValue="F"/>

Any help would be much appreciated!
-- 
View this message in context: http://www.nabble.com/nullValue-for-Boolean-wrapper-class-property-tp14725946p14725946.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


Re: nullValue for Boolean wrapper class property

Posted by top de castro <ro...@yahoo.com>.
Stephen, that did work for me.  I added a check for
null in the getResult method of my TypeHandlerCallback
class.  Thanks for the suggestion.


--- Stephen Boyd <sw...@gmail.com> wrote:

> This should be handled in your type handler callback
> if you have one
> implemented.
> 
> 
> 
> On Jan 9, 2008 8:28 PM, topgd
> <ro...@yahoo.com> wrote:
> 
> >
> > I am using a TypeHandlerCallback to map a Boolean
> property to a DB2
> > character(1) field that contains 'T' or 'F'.
> >
> > I cannot get the nullValue property to return the
> value "F" when the
> > database field value is NULL.  The exception is:
> >
> >    java.sql.SQLException: Unexpected value null
> found where T or F was
> > expected.
> >
> > Neither of these work:
> >  <result property="cardRequested" column="dp_card"
> nullValue="F"/>
> >  <result property="cardRequested" column="dp_card"
> javaType="Boolean"
> > jdbcType="CHARACTER" nullValue="F"/>
> >
> > Any help would be much appreciated!
> > --
> > View this message in context:
> >
>
http://www.nabble.com/nullValue-for-Boolean-wrapper-class-property-tp14725946p14725946.html
> > Sent from the iBATIS - User - Java mailing list
> archive at Nabble.com.
> >
> >
> 



      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 


Re: nullValue for Boolean wrapper class property

Posted by Stephen Boyd <sw...@gmail.com>.
This should be handled in your type handler callback if you have one
implemented.



On Jan 9, 2008 8:28 PM, topgd <ro...@yahoo.com> wrote:

>
> I am using a TypeHandlerCallback to map a Boolean property to a DB2
> character(1) field that contains 'T' or 'F'.
>
> I cannot get the nullValue property to return the value "F" when the
> database field value is NULL.  The exception is:
>
>    java.sql.SQLException: Unexpected value null found where T or F was
> expected.
>
> Neither of these work:
>  <result property="cardRequested" column="dp_card" nullValue="F"/>
>  <result property="cardRequested" column="dp_card" javaType="Boolean"
> jdbcType="CHARACTER" nullValue="F"/>
>
> Any help would be much appreciated!
> --
> View this message in context:
> http://www.nabble.com/nullValue-for-Boolean-wrapper-class-property-tp14725946p14725946.html
> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>
>