UserMapper here as a mapper interfaces, but in the UserService can instantiate, and don't need the @autowired, compiled to run there are no mistakes, don't know why this is,
In addition, if coupled with @autowired, instead, the IDEA will be prompted to "Could not autowire. No beans of 'UserMapper type found.", but does not affect the operation.
The younger brother who was recently in contact with the boot, a great god,
CodePudding user response:
UserMapper will generate implementation agent spirng using aop through JDK with directly, no need to worryCodePudding user response:
http://blog.csdn.net/je_ge/article/details/53313982CodePudding user response:
By spring construction methods to instantiate objects automatically by constructor injection parameters, if you write a constructor to remove single variable injection, the @autowired is is the constructor because only automatic injection