typeHandler for <parameterMap> and <resultMap> are handled differently
----------------------------------------------------------------------

         Key: IBATIS-130
         URL: http://issues.apache.org/jira/browse/IBATIS-130
     Project: iBatis for Java
        Type: Bug
  Components: SQL Maps  
    Versions: 2.1.0    
 Environment: any (Linux/Spring/Java 1.5)
    Reporter: Bubba Puryear


The SqlMapParser handles 'typeHandler' attributes for parameterMap's parameters 
and resultMap's results differently. In particular, a typeHandler must be a 
TypeHandlerCallback instance for parameterMap's parameter but can be either a 
TypeHandler or TypeHandlerCallback instance for resultMap's result.

This has implications with Spring integration. Spring provides a 
ClobStringTypeHandler (org.springframework.orm.ibatis.support) that works great 
for reading/writing CLOBs, but you can't specify it in a parameterMap since it 
isn't a TypeHandlerCallback. (this is actually true of all the CTH's that 
Spring provides, I just happen to want to use ClobStringTypeHandler)

The code in SqlMapParser treats these two cases differently. I have a patch 
(which I'll attach) that duplicates the result parsing code in the parameter 
parsing code. (I know, duplication is evil and all -- of course, that's kinda 
the source of the this problem in the first place)

Thanks,
Bubba

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to