ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chema <chemago...@gmail.com>
Subject Distinguish null and not null parameters
Date Wed, 23 Aug 2006 11:41:59 GMT
Hello:

I like to compose the next query

<select id="idQuery" parameterClass="com.project.ParameterClass"
resultClass="java.lang.String">
    SELECT ID FROM  TABLE
    WHERE
    <isNotNull property="field1">
        AND FIELD1 = #field1#
    </isNotNull>
    <isNull property="field1">
        AND FIELD1 IS NULL
    </isNull>
</select>

Is there another better way to distinguish null and not null parameters ?

With only one parameter is not problem like in the previous example  , but
really I need to make a comparision with many fields of ParameterClass ( All
parameters not named like fieldX )

Thanks a lot

Best regards

Mime
View raw message