ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brandon Goodin <brandon.goo...@gmail.com>
Subject Re: Dynamic sql statement
Date Fri, 27 Jan 2006 05:01:57 GMT
<isNotEmpty prepend="and" propery="area>

You mispelled *property*

Other than that, what is NOT working? are you getting an error? Is the
result wrong? What is it you want to accomplish?

Brandon

On 1/26/06, stevenlou@gmail.com <stevenlou@gmail.com> wrote:
> Dear all,
>
> I want to run one dynamic query like this:
>
> select * from cto.personinfovo where id=#id# and area=#area#
>
> But for "area" field, is has two conditions, one is for "ALL" and one is the
> input value, the ibatis XML file is like this and it's not working well,
>
>   <select id="selectALL" parameterClass="PersoninfoPO"
> resultClass="PersoninfoPO">
>        <![CDATA[ select * from cto.personinfovo ]]>
>     <dynamic prepend="where">
>         <isNotEmpty prepend="and" property="id">
>              <![CDATA[ (id=#id#) ]]>
>  </isNotEmpty>
>  <isNotEmpty prepend="and" propery="area>
>  (    <![CDATA[ (area=#area#) ]]>
>     <isEqual prepend="or" property="area" compareValue="ALL">
>              <![CDATA[(area in
> ('SC','EC','CC','NC','NE','SW','NW'))]]>
>            </isEqual>  )
>  </isNotEmpty>
>     </dynamic>
>   </select>
>
> Could any one give me the help?
>
> Thanks so much!
>
>
>

Mime
View raw message