nested exception is org.apache.ibatis.binding.BindingException: Parameter 'userId' not found. Availa

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/MonkeyBrothers/article/details/80808915

今天在使用springBoot开发项目的时候遇到了

nested exception is org.apache.ibatis.binding.BindingException: Parameter 'userId' not found. Available parameters are [goodsId, arg0, param1, param2]”的问题。

问题原因:

参数没有绑定成功

解决办法:

找到编写的mapper(有的人是dao)添加“@Param”注解进行绑定参数,例如:

SeckillOrder getSeckillOrderByUserIdGoodsId(@Param("userId")long userId, @Param("goodsId") long goodsId);
重启服务器即可。

猜你喜欢

转载自blog.csdn.net/MonkeyBrothers/article/details/80808915
今日推荐