java调用Hibernate3

xiaoxiao2021-02-27  768

String path=System.getProperty("user.dir"); ApplicationContext ct=new FileSystemXmlApplicationContext(path+"/src/applicationContext.xml"); BaseDao ccategoryService= (BaseDao) ct.getBean("baseDao"); CategoryService categoryService= (com.service.CategoryService) ct.getBean("CategoryService"); List<Category> aaa = categoryService.listAll(); System.out.print(aaa.size()+"");

转载请注明原文地址: https://www.6miu.com/read-46.html

最新回复(0)