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.

|
Current Comments
24 comments so far (post your own) View All Comments Latest 10 Comments:I want know if any one can help me about create my first application hibernate and eclipse
Posted by mustapha on Wednesday, 03.26.08 @ 02:14am | #54347
best for...bigginers.....but i need much more examples........cn u help?
Posted by sincy raj on Thursday, 01.17.08 @ 09:30am | #45404
I am desparetly looking example of hibernate.
Posted by Aditya on Friday, 12.28.07 @ 13:28pm | #44034
I am running into the following error when i try to run your example.Can anyone help me out?
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
at org.hibernate.cfg.Configuration.<clinit>(Configuration.java:120)
at FirstExample.main(FirstExample.java:18)
Posted by amar on Saturday, 12.22.07 @ 02:08am | #43293
hai this is srinu this is very useful to beginners.
Posted by srinu on Friday, 12.7.07 @ 15:13pm | #41525
Hai
this is venkat
i want brief explnation of Hibernate and i want important questions?
ok
Posted by venkat on Monday, 11.12.07 @ 20:00pm | #36985
what is the use of hibernet?
how it is used ina project?
what are the benefits of hibernet
Posted by mujeeb rahman on Wednesday, 10.17.07 @ 11:45am | #34256
AT first how to start about hibernate.
Let, u don't know about hibernate.But u have to
work about hibernate.Then how to start.And
how to finish.
pls inform me.
Posted by shamema on Sunday, 09.30.07 @ 11:27am | #30498
Good job,it's usefull to beginner!
Come on!
Posted by ethan on Thursday, 08.2.07 @ 07:35am | #22465
hi this is very usefull for the beginners in hibernate,
Posted by shashank reddy on Monday, 07.23.07 @ 21:10pm | #21789