Mybatis
yven_style
一个人有两块手表就永远不知道时间
展开
-
mybatis中${} #{}使用
一般${}用在我们能够确定值的地方,也就是我们程序员自己赋值的地方。 例如order by ${time}${}只是字符的替换,不能防止sql注入 而#{}一般用在用户输入值的地方!! select * from tab where id=#{id}转载 2017-09-26 10:02:08 · 342 阅读 · 0 评论 -
The content of element type "mapper" must match "(cache-ref|cache|resultMap*|parameterMap*|sql*| ins
在整合spring和mybatis过程中mapper.xml配置文件中出现了如下报错:The content of element type "mapper" must match "(cache-ref|cache|resultMap*|parameterMap*|sql*|insert*|update*|delete*|select*)+".删除其中的注释 解决问题。原原创 2018-02-06 09:30:44 · 5127 阅读 · 1 评论 -
mybatis知识点总结
1、resultMap、resultType、parameterType、parameterMap的区别:https://www.cnblogs.com/fengli9998/p/7991032.html2、#{}、${}的区别:1、#{}将传入的数据都当成是一个字符串,会自动对传入的数据加上一个双引号2、${}是一个替换的功能3、#{}方式可以很大程度上防止sql注入4、${}一般用于传入...原创 2018-03-08 22:26:27 · 296 阅读 · 0 评论