Fight the Future

Java言語とJVM、そしてJavaエコシステム全般にまつわること

iBatisでの動的SQL

こんな感じ。

  <select id="selectWithoutBLOBs" resultMap="ibatorgenerated_BaseResultMap" parameterClass="xxx.Xxx" >
    select id, xxx, xxx
    from xxx
    <dynamic prepend="where">
      <isNotNull prepend="and" property="xxx">
      xxx = #xxx:INTEGER#
      </isNotNull>
      <isNotNull prepend="and" property="xxx">
      xxx = #xxx:INTEGER#
      </isNotNull>
    </dynamic>
  </select>