ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "FranT" <mail...@reims-habitat.fr>
Subject My first dynamic statement
Date Fri, 01 Feb 2008 16:25:04 GMT
Hi there, i'm new ti iBatis and need help for my first dynamic statement.
Here it is:
 
 
<resultMap id="getDynam" class="my.ft.kcaldos">
        <result property="dndl" column="DNDL"/>
        <result property="ncal" column="NCAL"/>
        <result property="datcom" column="DATCOM"/>
    </resultMap>
        
    <select id="dynamis" parameterClass="java.util.Map"
                         resultMap="getDynam">
          SELECT dndl, ncal, datcom from kcaldos 
          <dynamic prepend="WHERE">
              <isNotNull prepend="AND" property="eced">
                   eced=#ec#
              </isNotNull>
              <isNotNull prepend="AND" property="demc">
                 demc=#dem#
              </isNotNull>
          </dynamic>
                  where datcom > to_date('01/01/2007','DD/MM/YYYY')
                  order by dndl
   </select>
 
When running it, i stil get;
 'SELECT dndl, ncal, datcom from kcaldos where datcom >
to_date('01/01/2007','DD/MM/YYYY') order by dndl'
even when the two properties (eced and demc) are not null.
May be i'm missing something somewhere ? Thanks in advance.



Mime
View raw message