• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Integrating Spring and Hibernate : Help needed

 
Manikandan Swaminathan
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello ranchers,

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.

Thanks
 
Hussein Baghdadi
clojure forum advocate
Bartender
Posts: 3479
Clojure Mac Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wrong forum to post, please wait for our moderators to move it kindly to an appropriate forum.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34074
337
Eclipse IDE Java VI Editor
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic