Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Dynamic Select SQL statements with MyBatis

 
Gabriela Rios
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I would like to have dynamic sql statements where I can utilize a hash map to add conditionals something like the following:

<select id="getUsers" resultType="hashmap" parameterType="hashmap">
select *
from users
<where>
<iterate var="i=0" increment>
$columni$ like #valuei#
</iterate>
</where>
</select>

Is there a way for me to accomplish something like that?

I appreciate your input on this.
Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic