Tell a friend
Link to us
Bookmark Us
Total Members
      Members: 87081
Sitemap Forum Chat
 
Java Home
Java Members (28736)
Java Member Articles ( 41 )
Java Discussion (283)
Java Q & A ( 172 )
- Java Ask Question
- Java Questions
- Java Unanswered Questions
Java Resources
Java Source Code (1096)
Java Articles (552)
Java Blogs (133)
Java Jobs (801)
Java Components (85)
Java Books (169)
Java Websites (127)
Java News (103)

 
Resource Directory
Java Hosting (0)
Source Code (0)

 
GROUP INFO
Members: 28736
Access Type: Anyone can join

 
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
LINQ Tutorial
Web Development
Flex Tutorial
HTML Tutorial
Javascript Tutorial
Learn AJAX Tutorial
PHP Tutorial
Software Development
Database Tutorial
SQL Tutorial
UML Tutorial
Java
Ant Tutorial
EJB 3 Tutorial
Grails Tutorial
Hibernate Tutorial
Java 1.6 Tutorial
Java Tutorial
Java Web Component Tutorial
Java XML Tutorial
JDBC Tutorial
JDK1.5 Tutorial
JSF Tutorial
JSP And J2EE Design Tutorial
JSP Tutorial
Service-Oriented Architecture (SOA) Tutorial For Managers
Spring Tutorial
Struts Tutorial
Tomcat Tutorial

RESOURCES
Q & A (531 )
Source Code (3276 )
Articles (365 )
Books (373 )
Components (1647 )
News (898 )
Websites (1208 )

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

COMMUNITY
Authors
Members Directory
Discussion Forum
Chat

SITE
About Us
Sitemap
Search
Contact Us
Feedback
Tell a Friend
Advertise

 

Home > Java > Member Articles > Database >
 

Hibernate Tutorial


  Author : VisualBuilder.com
  Date Published : 05/13/2007
  Accessed : 21272
   visualbuilder
<< Back  Next >> 

In object oriented systems,we represent entities as objects and classes and use database to persist those objects. Most of the data-driven applications today,are written using object oriented technologies. The idea of representing entities as set of classes is to re-use the classes and objects once written.


To understand the scenario,consider a web application that collects users personal information and stores them to the database. Also there could be a page that displays all the saved users. When implementing this kind of solution,  we may store the data by getting the request parameters and simply putting it into SQL insert statements. Similarly when displaying,we can select the desired record from the database,and display them on dynamic web page by iterating through the result set. But wait...does it sound good to have persistent related code scattered everywhere on the web page? What if we need to modify the design of our database after we have developed few pages? Or even if we want to replace our low-cost development database with an enterprise-class production database that have entirely different SQL syntax? Do we need to change the SQL queries everywhere in our code?


To overcome this problem,we may want to develop JavaBeans representing the entities in the database. We can develop a Persistence Manager that can operate on the given JavaBean and perform several persistent operations like fetch,store,update,search etc. so that we don't need to write persistence related code in our core area of application. Advantage of using this technique is that we can pass on this simple JavaBean to any of the different layers of the application like a web layer,an EJB layer or any other layer we may have in our application.


We have isolated our persistence related code so that whenever there is a change in the design,or we change the database environment we can change our persistence code. Or we can have several copies of the Persistence Manager to work with different databases so that based on some configuration parameter,we can choose the right Persistence Manager instance. But this is still very difficult as we might ignore some database specific settings while writing so many Persistence Managers for different applications.


Here the concept of Object Relational mapping comes. By Object Relational mapping (O/R mapping) we mean the one-to-one mapping of class attributes with the columns of a database entity. Mapping includes the name of the attribute versus database field,the data type,and relation with other entities or classes. So if we write a framework that can take the object to relation mapping and provide persistence facilities on the given JavaBeans,we can use it for different applications and different databases. So,if anyone want to configure the application on a database that was not known at the time of writing the framework,he can simply write a mapping file and the application will start working on that environment.


Thanks to the open source community! we don't need to write such frameworks anymore. We have Hibernate which allows Object/Relation mapping and provides persistence to the abject with the help of simple APIs where we can specify the operations and the operands (JavaBeans).


Pages   << Back  1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19  20  21  22  Next >>  Next: Part 4: JDBC >>

 
   Printer Friendly
   Email to a friend
   Add to my Favourites  Report Bad Submissions  Submit Feedback
  Download PDF version
 
                 Click each image to add
this page to each site.
 
Related Articles of Java
Previous Article    -     Random Articles    -     Next Article
 
 
 
 
 
 
 
 
Welcome Guest Signup
Member's Panel
EMAIL
PASSWORD
Forgot your password?
New User? Click Here!
 
Resend Activation Email!

SEARCH
 



 
 
 
 
 


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

Warning: Unknown(): write failed: Disk quota exceeded (122) in Unknown on line 0

Warning: Unknown(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0