因为spring在3.1之后的版本中把 AnnotationSessionFactoryBean与LocalSessionFactoryBean集成到了一起,统一用org\springframework\orm\hibernate4\LocalSessionFactoryBean。 不再有AnnotationSessionFactoryBean类; 但是org.springframework.orm-3.1.1.RELEASE.jar 依然保留有org\springframework\orm\hibernate3这个包,这是为了向下兼容。所以改成hibernate4即可!
2017-04-23
用的hibernate4 为什么添加数据成功 但是为空?SQL也显示出来了 private SessionFactory sessionFactory; public void save(Product product){ Session session = this.getSessionFactory().openSession(); Transaction tx = session.beginTransaction(); session.save(product); tx.commit(); session.close(); }
2017-04-23
Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is java.io.FileNotFoundException: class path resource [domain/Users.hbm.xml] cannot be opened because it does not exist这是哪里的错啊
2017-04-22
HibernateDaoSupport是spring框架下spring-orm jar包下的一个类,hibernate框架是没有的.....
2017-04-19