ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris McMahon <cochran...@hotmail.com>
Subject Determining Nulls with parameterClass="map"
Date Fri, 30 Nov 2007 17:34:59 GMT
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.
http://im.live.com/messenger/im/home/?source=TAGLM
Mime
View raw message