Unfortunately, to fully explain it all would take a lot of time. So I am going to just do the basics.
1) Do you understand Spring and Spring configuration?
If you do then this will make sense.
Basically to integrate Hibernate with Spring, and that also means a Spring MVC application. Is to configure and start Hibernate via Spring configuration.
To do that you basically create a <bean> where you use Spring's LocalSessionFactoryBean or AnnotationSessionFactoryBean class as the class="" part of the <bean> tag.
Then you just set that bean's properties. In this case, you don't need a hibernate.cfg.xml file anymore, all that configuration is now in that <bean> tag. That is typically how you integrate Hibernate in Spring. It is all documented in the Core Spring documentation. Under the data sections, right after
jdbc. (FYI, you can also set a property of those FactoryBean classes to point to the hibernate.cfg.xml file)
Look at the section 13.3 Hibernate here for more info on the FactoryBean configuration.
http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/orm.html
You can also have Spring automatically do a lot for you with Spring ROO.
Remember to check your private messages for that important message from us moderators.
Mark