• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Hibernate

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Please can anybody let me know that what is hibernate and how to use it with struts ?? can some one please suggest me any good book or online examples or tutorials for the same??
 
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HibernatePlugin for struts

http://sourceforge.net/projects/struts
 
author
Posts: 114
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
AppFuse (http://appfuse.dev.java.net) and Equinox (http://equinox.dev.java.net) have examples of using Hibernate with Struts (and Spring!).
 
author
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hibernate is a persistence framework with a strong orientation to addressing the object-relational impedance problem. Data is stored in a relational structure, but your Java design wants to interact with them as objects. Hibernate is a tool to allow you to interact with you relational data as objects. Hibernate is good for rich domain architectures. Hibernate isn't the only persistence framework that can do that, but its very good at it.

You can either use Hibernate with Struts -or- you can use Hibernate and Struts. There's a difference.

Matt pointed out the Struts plugin that can be used to use Hibernate with Struts. Although the plugin works very well, you must resign to the fact that your Struts Action is going to know about Hibernate. If you need to switch from Hibernate to something else (say iBATIS), then you need to touch a lot of code. A better approach is to use Struts and Hibernate.

Using Struts and Hibernate means that you use them both, but neither knows about each other. The best approach to that is to create a layered application using DAOs. The DAO hides the fact that you are using Hibernate. This allows you to have an orthogonal application. That is to say, the two can co-exist, and can change without impacting each other.

You asked if there are any books on the subject. Funny you should ask that .... In Struts Recipes we present two recipes on both strategies. We have a recipe that shows how to use the Struts Hibernate plug-in. We have another recipe that shows how to create a layer Struts application. We show it both ways!

Another good approach is wiring up Struts to Spring, then wire Spring to Hibernate. Matt's book will show you how to do that.

There you have it. You asked one question and I gave you three answers. Sorry.
 
Climb the rope! CLIMB THE ROPE! You too tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic