VisualBuilder
  Home > Java > Tutorials > Spring data access example using Hibernate - Spring tutorial
Tell a friend
Link to us
Total Members
      Members: 84648
     
Sitemap Forum Chat
Home
Spring Tutorial Tutorial Home
1 . What is Spring?
2 . What are the main concepts for Spring?
3 . Why use Spring?
4 . Spring architecture
5 . Installing Spring
6 . Where is Spring in our applications?
7 . How to create a bean descriptor XML file?
8 . Spring and Struts
9 . Spring and Struts - Hello World example
10 . Spring data access overview
11 . Spring data access example using Hibernate
12 . Next Steps
 
Java Group Home
Java Discussion (273)
Java Members (27593)
Java Resources
Java Source Code (1095)
Java Articles (5)
Java Blogs
Java Jobs
Java Components (84)
Java Books
Java Websites (126)
Java News (103)
Java Q & A (114)
- Java Ask Question
- Java Questions
- Java Unanswered Questions
 
GROUPS
.NET
ASP.NET
.NET
C#
ASP
Visual Basic
Java
Java
JSP
EJB
Other
Delphi
C++
Ajax
UML
JavaScript
PHP
Web Design
Web Hosting
SQL Server
Oracle
Project Management
More Groups

 
LEARNING CENTER
TUTORIALS
.NET
.NET Tutorial
ASP Tutorial
ASP.NET Database Tutorial
ASP.NET Development Tips
ASP.Net Security,Internationalisation And Deployment
ASP.NET Server Controls Tips
ASP.NET Tutorial
C Sharp Tutorial
Web Development
Flex Tutorial
HTML Tutorial
Learn AJAX Tutorial
PHP Tutorial
Software Development
Database Tutorial
SQL Tutorial
UML Tutorial
Java
Ant Tutorial
EJB 3 Tutorial
Hibernate Tutorial
Java Tutorial
Java Web Component Tutorial
Java XML Tutorial
JDBC Tutorial
JDK1.5 Tutorial
JSF Tutorial
JSP And J2EE Design Tutorial
JSP Tutorial
Spring Tutorial
Struts Tutorial

RESOURCES
Q & A (436 )
Source Code (3275 )
Articles (11 )
Components (1589 )
News (888 )
Websites (1207 )

SUBMISSIONS
Submit Article
Submit Website
Submit News
Submit Source Code
Submit Component

COMMUNITY
Members Directory
Discussion Forum
Chat

SITE
About Us
Sitemap
Search
Contact Us
Link To Us
Feedback
Tell a Friend
Partners
Advertise


Java spring Tutorial
 Spring data access example using Hibernate
  << Prev: Spring data access overview Next: Next Steps >>

This example is web application running as a book search engine. Techniques used are Struts,Spring,and Hibernate.

Hibernate overview
Hibernate is a powerful,high performance object/relational persistence and query service. Hibernate lets you develop persistent classes following object-oriented idiom – including association,inheritance,polymorphism,composition and collections. Hibernate allows you to express queries in its own portable SQL extension (HQL),as well as in native SQL.


For more information,go to the home site of Hibernate at
http://www.hibernate.org

Hibernate allows you map data tables to objects and use these object for data operation instead of accessing directly to data tables,as description below:




Design and code
Architecture of the example looks as:




In there:
• Struts layer controls request
• Hibernate layer accesses real database
• Spring layer register Hibernate services as beans so Struts layer can use them
We created the Spring.hibernate.bean.xml file to declare Hibernate data service as below:




You can see two extend Spring classes: BookService and CategoryService were declared as beans: bookService and categoryService

How to deploy and run
Before doing that,must ensure your classpath environment variable point to Spring and Hibernate lib folder.


The simplest way is to copy all jar files of Spring and Hibernate lib folders to the lib folder of the web application. The figure below shows that the web lib folder contains all lib jar files of Spring and Hibernate:


  << Prev: Spring data access overview Next: Next Steps >>
Java Spring Tutorial Home
Give feedback and win a prize.

 
   Printer Friendly
   Email to a friend
   Add to my Favourites    
  Download PDF version
   Report Bad Submissions
   Submit Feedback
 
  Delicious   Digg   Technorati   Blink   Furl   Reddit   Newsvine   Google Click each image to add
this page to each site.
 
 
Welcome Guest Signup
MEMBER'S PANEL
EMAIL
PASSWORD
Forgot your password?
New User? Click Here!
 
Resend Activation Email!
 
SEARCH
 
 
LINKS
MSN
Video Surveillance
VoIP Internettelefonie AT
Gift to Pakistan
 
ADVERTISEMENT
 
PARTNER LIST

More
 
 
 

Home | Login | About Us | Contact Us | Privacy Policy | Advertising