ibatis-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "somakani (JIRA)" <ibatis-...@incubator.apache.org>
Subject [jira] Commented: (IBATIS-244) CLONE -configured type handler not used in insert
Date Tue, 17 Jan 2006 10:43:43 GMT
    [ http://issues.apache.org/jira/browse/IBATIS-244?page=comments#action_12362951 ] 

somakani commented on IBATIS-244:


I am still experiencing the problem previously reported.   It is related to primitive data
types.  If the property is the primitive "boolean" the parser does not register the handler
correctly.  The problem arises from the type alias for "boolean" which maps to the object
class "java.lang.Boolean".  But the class for the property is really "boolean.class" not "Boolean.class".
 There appears to be no way to set a handler that would override  "boolean.class" since the
alias checking always wins.

The same problem will affect all the other primitive types.

One possible suggestion is to add an attribute to the typeHandler tag akin to: useClassAlias="yes|no"
and in the nodelet code just avoid the call to typeHandler.resolveAlias.

> CLONE -configured type handler not used in insert
> -------------------------------------------------
>          Key: IBATIS-244
>          URL: http://issues.apache.org/jira/browse/IBATIS-244
>      Project: iBatis for Java
>         Type: Bug
>   Components: SQL Maps
>     Versions: 2.1.0
>  Environment: linux, java 1.5
>     Reporter: somakani
>     Assignee: Clinton Begin
>     Priority: Minor
>      Fix For: 2.1.5

> Custom type handlers which are configured within SqlMapConfig, such as:
> <typeHandler javaType='java.lang.Boolean' jdbcType='CHAR' callback='com...BooleanTypeHandler'/>
> are working properly and automatically to convert types for queries.  However for inserts,
the type conversion is not being called based on the above type handler mapping.  We have
confirmed this behavior by placing debug print statements in the methods of the type handler
being used.
> What does work, and what we're currently using as a workaround, is to use an explicit,
inline type handler within the insert map (such as #private,handler=com...BooleanTypeHandler#).

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message