I had an existing project using Hibernate and now want to move to Spring.
The demo on Spring reference sets all hibernate properties for LocalSessionFactoryBean. However, as I read the Spring Javadoc of LocalSessionFactoryBean class, you can actually specify an existing hibernate.cfg.xml file. (LocalSessionFactoryBean.setConfigLocation(Resourc e configLocation) ).
My question is, how do I configure this in my applicationContext.xml file?
I guess it should be something look like this, but not exactly sure:
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSes sionFactoryBean">
because the setConfigLocation takes a Resource parameter, but not a String, so I guess I must do something to get a Resource bean which is my hibernate.cfg.xml