ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Larry Meadors" <lmead...@apache.org>
Subject Re: Determining Nulls with parameterClass="map"
Date Fri, 30 Nov 2007 17:46:19 GMT
Will isEmpty work in your case?

Larry


On Nov 30, 2007 10:34 AM, Chris McMahon <cochrane68@hotmail.com> wrote:
>
> I'd like to have a where clause that can be dynamically built with "name is
> null", "name = #name#", or nothing at all.
>
> <select id="selectFiles" parameterClass="map">
>     select * from files
>     <dynamic prepend="where">
>         where
>         <isPropertyAvailable property="name">
>             <isNull property="name">
>                name is null
>             </isNull>
>             <isNotNull property="name">
>                name = #name#
>             </isNotNull>
>         </isPropertyAvailable>
>     </dynamic>
> </select>
>
> What I have here doesn't seem to work.  If the name is set to null, it
> always fails the <isPropertyAvailable> condition.
>
> How are determining and setting nulls usually handled with iBATIS?
>
> Thanks.
>
>
> ________________________________
> You keep typing, we keep giving. Download Messenger and join the i'm
> Initiative now. Join in!

Mime
View raw message