Cheers,
Clinton
On 6/13/05, Jim Newsham <[EMAIL PROTECTED]> 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/[email protected]/msg00570.html
)
Thanks,
Jim
