I want to assemble multiple Dao at the same time,
@Autowired
WeatherReportDao weatherReportDao;
@Autowired
AtmosphereReportDao atmosphereReportDao;
Now it is written like this, can I use @Autowired only once?
怪我咯2017-05-17 10:10:53
Brother, you are quite lazy. This world is for lazy people.
You can write an abstract base class, and then let all your classes that need to do this inherit this base class.
In this way, you don’t have to write Annotated, but the key point is that you still need to write a custom bean factory
怪我咯2017-05-17 10:10:53
No, because the annotations are based on the annotations you write based on the scanner, and spring creates the object for you,