![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
mybatis那些事
flysun55
这个作者很懒,什么都没留下…
展开
-
mybatis中#{}和${}区别
开发思考由来: <select id="findUserById" parameterType="int" resultType="com.zzu.ssm.po.User"> select * from user where id=#{id} </se原创 2018-10-03 19:53:59 · 122 阅读 · 0 评论 -
Type interface XXXMapper is not known to the MapperRegistry
错误: org.apache.ibatis.binding.BindingException: Type interface com.zzu.ssm.dao.UserMapper is not known to the MapperRegistry. 用Mybatis的时候爆出的一个错误,主要原因是Mappper.xml里面的namespace 和对应的接口地址不一样 ...原创 2018-10-04 10:47:26 · 11835 阅读 · 5 评论 -
Invalid bound statement (not found): xxxx
错误 Invalid bound statement (not found): com.zzu.ssm.mapper.UserMapper.findUserById 解决思路 请任意修改下对应的xml文件,比如删除一个空行,保存.可能问题解决… UserMapper的方法在UserMapper.xml中没有,然后执行UserMapper的方法会报此 mapper的namespace检查是否正确。...原创 2018-10-05 12:01:40 · 273 阅读 · 0 评论 -
Mapped Statements collection already contains value for xxx
Mapped Statements collection already contains value for com.zzu.ssm.mapper.UserMapper.findUserById 原因: 1.xml文件中有相同的id ,例如findUserById出现两次; 2.sqlSessionFactory 加载了两次相同的xml文件。 <mapper resource="...原创 2018-10-05 12:56:33 · 829 阅读 · 0 评论 -
Java源码跟踪阅读技巧
这些是MyBatis源码学习时总结的小技巧 Quick Type Hierarchy 快速查看类继承体系。 快捷键:Ctrl + T Open Call Hierachy 打开调用层级 快捷键:Ctrl+Alt+H - 第一个是 openSession() 方法的所有调用者 - 第二个是 调用的哪个类的 openSession() Debug 断点的灵活使用 ...原创 2018-10-09 20:58:14 · 1245 阅读 · 0 评论