ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From reub...@sonic.net
Subject Re: isNotNull / insert / custom type handler
Date Thu, 17 Nov 2005 23:40:59 GMT
Thanks. I added the stacktrace to the JIRA issue.

The experiment didn't work.

BTW, my workaround currently is to use the nullValue syntax inline, which
works fine.

> Hello,
>
> We'll need a stack trace. Just for kicks though, try specifying the type
> explicitly:
>
> #deploymentStatusId:NUMERIC# or whatever it is...
>
> Cheers,
> Clinton
>
>
> On 11/16/05, reubenf@sonic.net <reubenf@sonic.net> wrote:
>>
>> Is this a bug, or am I doing something wrong?
>>
>> 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.
>>
>>
>> http://issues.apache.org/jira/browse/IBATIS-224
>>
>> (I will close the bug in JIRA if this turns out to be my problem...)
>>
>>
>>
>



Mime
View raw message