ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Clinton Begin <clinton.be...@gmail.com>
Subject Re: configured type handler not used in insert
Date Tue, 14 Jun 2005 03:29:17 GMT
Hmm...might be a bug. Best to log a JIRA issue for this one and we'll look 
into it.

Cheers,
Clinton

On 6/13/05, Jim Newsham <newsham@hawaii.rr.com> wrote:
> 
> 
> Hi,
> 
> We just recently started using iBatis. We're using version 2.1.0. We
> have a few fields whose types are not the basic, built-in supported
> types. We discovered that we can implement a TypeHandlerCallback for
> each such type. The type handlers are defined in SqlMapConfig, such as:
> 
> <typeHandler javaType='java.lang.Boolean' jdbcType='CHAR'
> callback='com...BooleanTypeHandler'/>
> 
> With this handler installed, the type conversion is done automatically
> for queries. But for inserts, the type conversion is not called (this
> is confirmed with some debug statements in the type handler). The
> result is a null pointer exception.
> 
> I discovered that we can include an explicit, inline type handler within
> the insert map (such as #private,handler=com...BooleanTypeHandler#).
> This is the workaround we're using for now, but the question is, why is
> this explicit mapping necessary when the type handler has been declared
> to handle all boolean types, as shown above?
> 
> (P.S.: Not sure if this stuff is documented here; here are some
> references I found:
> 
> 
> http://opensource.atlassian.com/confluence/oss/display/IBATIS/How+do+I+use+a+Custom+Type+Handler+with+complex+property+or+Type+Safe+Enumeration%3F
> 
> http://www.mail-archive.com/ibatis-user-java@incubator.apache.org/msg00570.html
> )
> 
> Thanks,
> 
> Jim
> 
>

Mime
View raw message