其他分享
首页 > 其他分享> > @Autowire注解注入问题

@Autowire注解注入问题

作者:互联网

Could not autowire. No beans of ‘xxxxxxMapper’ type found:

方法1:在mapper文件上加@Repository注解,这是从spring2.0新增的一个注解,用于简化 Spring 的开发,实现数据访问
方法2:在mapper文件上加@Component注解,把普通pojo实例化到spring容器中,相当于配置文件中的

标签:mapper,Autowire,配置文件,文件,No,注解,上加,注入
来源: https://blog.csdn.net/yan66666699999/article/details/123087838