JavaBeat
Hibernate Home Articles Resources Tutorials Hibernate Interview Questions & FAQs JSF QnA Code Junction

1. What is Hibernate?

2. Hibernate Architecture

3. Writing First Hibernate Code

4. Understanding Hibernate O/R Mapping

5. Understanding Hibernate <generator> element

6. Using Hibernate <generator> to generate id incrementally

7. Hibernate Query Language

8. Preparing table for HQL Examples

9. Writing ORM for Insurance table

10. HQL from clause Example

11. Hibernate Select Clause

12. HQL Where Clause Example

13. HQL Group By Clause Example

14. HQL Order By Example

15. Hibernate Criteria Query Example

16. Criteria Query Examples

17. Hibernate Native SQL Example

Hibernate Architecture

In this lesson you will learn the architecture of Hibernate.  The following diagram describes the high level architecture of hibernate:



The above diagram shows that Hibernate is using the database and configuration data to provide persistence services (and persistent objects) to the application.


To use Hibernate, it is required to create Java classes that represents the table in the database and then map the instance variable in the class with the columns in the database. Then Hibernate can be used to perform operations on the database like select, insert, update and delete the records in the table. Hibernate automatically creates the query to perform these operations.

Hibernate architecture has three main components:

  • Connection Management
    Hibernate Connection management service provide efficient management of the database connections. Database connection is the most expensive part of interacting with the database as it requires a lot of resources of open and close the database connection.
      

  • Transaction management:
    Transaction management service provide the ability to the user to execute more than one database statements at a time.
      

  • Object relational mapping:
    Object relational mapping is technique of mapping the data representation from an object model to a relational data model. This part of the hibernate is used to select, insert, update and delete the records form the underlying table. When we pass an object to a Session.save() method, Hibernate reads the state of the variables of that object and executes the necessary query.

Hibernate is very good tool as far as object relational mapping is concern, but in terms of connection management and transaction management, it is lacking in performance and capabilities. So usually hibernate is being used with other connection management and transaction management tools. For example apache DBCP is used for connection pooling with the Hibernate.

Hibernate provides a lot of flexibility in use. It is called "Lite" architecture when we only uses the object relational mapping component. While in "Full Cream" architecture all the three component Object Relational mapping, Connection Management and Transaction Management) are used.





Sponsors
Webmaster Hosting Forum
Java Jobs
MyVideoLib
India News
Internet Advances
Latest QnA
Describe the lifecycle of a receiver application in order to receive a message?
Messages are not successful until they have been acknowledged. What are the types of acknowledgments?
What happens to messages if a transaction is rolled back?
What is the Role of the JMS Provider?
What is JMS administered object ?

JavaBeat Media (2004-2008), India
javabeat | planetoss | links directory | advertise
Copyright (2004 - 2008), JavaBeat