Autowired实现多个实现类
@Autowired 如何实现多个实现类
解决方案
@Service("a")
public class AService implements Service {}
@Service("b")
public class BService implements Service {}
1
2
3
4
5
@Qualifier("a")
@Autowired
Service aService;
@Qualifier("b")
@Autowired
Service bService;
1
2
3
4
5
6
7