Springboot整合mybatis mapper注入时显示could not autowire的解决
Springboot整合mybatis mapper注入时显示could not autowire的错误
1.解决方法,在mapper加一个注解。如下图所示:
@Mapper
@Component(value = “StudentDao”)
尽量不要使用@Repository,虽然可以去掉红线,但是是属于hibernate。如果使用就是存在俩个持久层框架,比较伤内存。切记。
- 解决办法