此外,如果加上@Autowired ,IDEA反而会提示“Could not autowire. No beans of 'UserMapper' type found.”,但是不影响运行.
小弟最近刚刚接触boot,望大神讲解。
...全文
7023打赏收藏
Spring Boot如何自动实现的接口实例化?
这里UserMapper为一个mapper接口,但是在UserService里可以将其实例化,而且不需要@Autowired ,编译运行起来还没有错误,不明白这是为什么。 此外,如果加上@Autowired ,IDEA反而会提示“Could not autowire. No beans of 'UserMapper' type found.”,但是不影响运行. 小弟最近刚刚接触boot,望大神讲解。