springboot整合mybatis mapper注入时显示could not autowire的错误,不影响使用,但是看着不爽,如下图:
解决方法,在mapper加一个注解。如下图所示:
@Component(value = “userMapper”)
本文介绍了解决SpringBoot整合MyBatis时出现的couldnotautowire错误的方法。通过在Mapper上添加@Component注解可以消除该警告,确保了项目的整洁。
springboot整合mybatis mapper注入时显示could not autowire的错误,不影响使用,但是看着不爽,如下图:
解决方法,在mapper加一个注解。如下图所示:
@Component(value = “userMapper”)

被折叠的 条评论
为什么被折叠?