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...)


Reply via email to