1、根据类获取对象

@Autowired
 ApplicationContext context;

GenericMapper<T,String> dao=(GenericMapper<T,String>)context.getBean(TestDaoImpl.class);

2、根据接口获取实现类的对象

@Autowired
ApplicationContext context;


GenericMapper<T,String> dao=(GenericMapper<T,String>)context.getBean(TestInterface.class);

 

相关文章:

  • 2021-10-12
  • 2022-02-16
  • 2022-12-23
  • 2022-12-23
  • 2022-03-05
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-02-17
  • 2022-12-23
  • 2022-01-05
  • 2021-12-19
  • 2023-03-19
相关资源
相似解决方案