0
点赞
收藏
分享

微信扫一扫

@Autowire注解注入问题

荷一居茶生活 2022-02-23 阅读 51

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

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

举报

相关推荐

0 条评论