I am bit confused in the integration of spring and hibernate.In one of our projects, they have used JSF,Spring IOC,EJB & hibernate.
So the code flow is something like this:
JSF --> valuebean/Managedbean --> EJB --> ServiceLayer (Interace & Impl class) --> DAO (Interface & Impl class) .
There are also screen objects & value objects which do the work of DTO's.
When i googled for spring & hibernate integration in the net, i got many examples which had examples like specifying the hibernate.proerties file in spring configuration file, usage of hibernate template etc. But i was not able to find anything like that in our project.But they have used some lookup configuration for EJB's in spring configuration file.
Suppose,if i am not using EJB's at all, in that case,is any other configuration required for integrating spring & hibernate? (Assuming i am using only spring IOC here..).Please advise me. I am confused on this.
To integrate Hibernate into Spring you would create a bean where the class is LocalSessionFactoryBean or AnnotationSessionFactoryBean, this would take place of your hibernate.cfg.xml. If using Hibernate 3.1 or higher, then you just inject your sessionFactory bean into your DAO/Repositories.