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

Reply via email to