• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to integrate JSF and Hibernate

 
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I want to ask that can we integrate JSF with Hibernate.
If yes then can you please give me some link through which i can proceed.

Thanks
Regards
Gaurav
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is no trick to integrating JSF and Hibernate. Use Hibernate in your backing beans and/or business logic classes just as you would using Servlets or whatever else.
 
Ranch Hand
Posts: 293
Mac OS X Netbeans IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JSF doesn't cover database access, so I would develop the web front end in JSF irrespective of database layer. You would then access your database layer as Hibernate objects from within your backing beans. If you want to have a layer of independence so you can use something other than Hibernate, I would suggest you use a DAO type of facade.
 
Saloon Keeper
Posts: 27819
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Spring is good for Hibernate. There's a connector that you define in the faces-config.xml file that will make faces-config able to reference Spring-defined DAO objects and inject them into JSF managed beans.
 
Dave Salter
Ranch Hand
Posts: 293
Mac OS X Netbeans IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tim, that sounds very interesting. Is that connector basic Spring functionality, or is it something else? Do you have a url?
 
author
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
FYI,

Chapter 9 provides coverage on building a data access layer along with a Hibernate implementation.

Basically I just have an interface that has data operations: getAllTrainingEvents(), getTrainingEventsForUser(), deleteTrainingEvent() etc..
(Training events are the items used in the Virtual Trainer example app)

It then show examples of classes that implement the interface and one of them uses Hibernate to do this.


-Chris
 
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We use JSF and Hibernate in the projects for our customers very often.
The common approach is decribed in the following blogs:

Use Hibernate and JSF with Less Coding
Hibernate mapping patterns for legacy databases: Part I
 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Dave Salter:
Tim, that sounds very interesting. Is that connector basic Spring functionality, or is it something else? Do you have a url?



The complete distribution is available to download at Spring official site. You can also download just Spring-JSF library particularly from the same site.
 
ram gaurav
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot to you all for giving me such a great direction.

Thanks
Regards
Gaurav
 
Could you hold this puppy for a sec? I need to adjust this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic