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);