SSH整合后,hibernate配置文件有什么用?

SSH整合后,数据源、映射文件、hibernate属性都被放到了spring的配置文件中了,是不是hibernate.cfg.xml文件已经不起作用了?那可以删了么?

第1个回答  2011-08-29
在spring里配置了的话,就可以不用hibernate.cfg.xml了
第2个回答  2011-08-28
是这样的,直接在spring配置文件上写好了,实体的配置文件还是要的。追问

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in file [D:\WorkSpace\.metadata\.me_tcat\webapps\liberInfo\WEB-INF\classes\applicationContext.xml]: Invocation of init method failed; nested exception is java.io.FileNotFoundException: class path resource [hibernate.cfg.xml] cannot be resolved to URL because it does not exist

追答

把你的bean中 id为sessionfactory 的配置内容发来看看

追问

字数超过限制 , 发图的 不知道能不能看清

本回答被提问者采纳
第3个回答  2011-08-28
可以不要hibernate.cfg.xml
第4个回答  2011-08-28
谁然用不上了 但为什么要删了又不占什么资源
相似回答