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 Mike Fagan <mf...@tde.com> on 2005/03/29 07:56:50 UTC

Way to get specified nullValue in TypeHandlerCallback

Hi,

Is there a way to get the nullValue specified in the result map when a 
TypeHandlerCallback is invoked so I can gracefully deal with null values?



Re: Way to get specified nullValue in TypeHandlerCallback

Posted by Nathan Maves <Na...@Sun.COM>.
here is the way I get around it.

	public Object getResult(ResultGetter getter) throws SQLException {
         int value = getter.getInt();
         if (getter.wasNull())
             return null;
         return Frequency.get(value);
     }

only rule here is that you have to call the getter.getInt() before the 
wasNull() check.

Nathan


On Mar 28, 2005, at 10:56 PM, Mike Fagan wrote:

> Hi,
>
> Is there a way to get the nullValue specified in the result map when a 
> TypeHandlerCallback is invoked so I can gracefully deal with null 
> values?
>
>