ibatis-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sven Boden (JIRA)" <ibatis-...@incubator.apache.org>
Subject [jira] Commented: (IBATIS-224) isNotNull node causes typehandler mappings in statement to fail
Date Mon, 27 Feb 2006 07:43:57 GMT
    [ http://issues.apache.org/jira/browse/IBATIS-224?page=comments#action_12367909 ] 

Sven Boden commented on IBATIS-224:

Been thinking a bit on IBATIS-224/210.  What about doing a static evaluation/reflection in
UnknownTypeHandler whether getEnclosingClass() is available on Class, and if it is available
use it as in the patch. 

This would make iBATIS work with enums in JDK 5 in all cases. I know we don't support 1.5
or enums/generics yet, but it's going to come anyway in the future, and the above doesn't
break the current version.

Any thoughts/comments?

> isNotNull node causes typehandler mappings in statement to fail
> ---------------------------------------------------------------
>          Key: IBATIS-224
>          URL: http://issues.apache.org/jira/browse/IBATIS-224
>      Project: iBatis for Java
>         Type: Bug
>   Components: SQL Maps
>     Versions: 2.1.6
>  Environment: linux/java 1.5
>     Reporter: Reuben Firmin
>     Priority: Critical
>  Attachments: ibatis-224_sven.zip, ibatis224.tar.gz
> Here's my insert statement.
>     <insert id="createDeployment" parameterClass="deployment">
>         INSERT INTO Deployment (
>             environmentId, deploymentTypeId, deploymentStatusId, deploymentTime
>                 <isNotNull property="threadCountOverride">,threadCountOverride</isNotNull>
>         ) VALUES (
>             #environmentId#, #deploymentTypeId#, #deploymentStatusId#, #deploymentTime#
>                 <isNotNull property="threadCountOverride">,#threadCountOverride#</isNotNull>
>         )
>         <selectKey resultClass="int" keyProperty="deploymentId">
>             SELECT @@IDENTITY as value
>         </selectKey>
>     </insert>
> deploymentTypeId and deploymentStatusId are enums in the bean, mapped to values using
custom type handlers. Without the isNotNull structure around threadCountOverride (which *is*
nullable), the statement works. With the isNotNull, deploymentStatusId and deploymentTypeId
are mapped to UnknownTypeHandler, and the insert fails to map the parameters from the bean.

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