随笔分类 - j2ee
摘要:MyBatis的动态SQL是基于OGNL表达式的,它可以帮助我们方便的在SQL语句中实现某些逻辑。MyBatis中用于实现动态SQL的元素主要有:ifchoose(when,otherwise)trimwheresetforeachif:choose:where:set:update t_blogtitle = #{title},content = #{content},owner = #{owner}where id = #{id}foreach:主要用在构建in条件中,它可以在SQL语句中进行迭代一个集合。foreach元素的属性主要有item,index,collection,open,
阅读全文