Springboot项目报mybatis的错误,org.apache.ibatis.binding.BindingException:Parameter 'uid' not found.

在Springboot项目中使用了mybatis作为orm模型,项目中报错如下:

后经检查是由于在mybatis生成的Mapper文件中,使用了spring提供的org.springframework.data.repository.query.Param包,改成org.apache.ibatis.annotations.Param包就可以。究其原因是由于我在mybatis的xml中使用的是mybatis的变量引用,而在Mapper文件中使用的是spring变量引用,导致出错。

具体关于spring中@param和mybatis中@param使用区别不再介绍,有兴趣的可以参读 http://blog.csdn.net/gao36951/article/details/44258217 ,文中作者做了详解。

发布了28 篇原创文章 · 获赞 6 · 访问量 4万+

猜你喜欢

转载自blog.csdn.net/qq_33996921/article/details/79035465