Hibernate Architecture

In this tutorial you will learn about the Hibernate architecture.

Ads

Tutorials   
How to write hello world example program in Hibernate? How to create one to one relationship in Hibernate 4 with Annotation? How to calculate minimum in Hibernate using the min() Function Hibernate 4.3.4 Released: Hibernate 4.3.4.Final Maven dependency Hibernate 4.3 Hello World: Example How to create SessionFactory in Hibernate 4.3.1? Hibernate 4 Hello World: Example of Hello World program Hibernate 4 create Session Factory: Example of creating Session Factory in Hibernate 4 Hibernate 4.3 and JPA 2.1 Example What is Hibernate in Java? Hibernate Overview and Architecture What is JPA 2.1? Hibernate 4.3.0.Final Maven dependency Hibernate 4.3 ORM Features Hibernate 4.3 Tutorial Hibernate Criteria average example Hibernate Criteria load all objects from table Hibernate Criteria Hibernate beginner tutorial Hibernate Session.delete() Example Hibernate save or update method example Hibernate Load Example Hibernate save Example - Rose India Hibernate 4 tutorials Hibernate Example Step by Step in Eclipse Hibernate Configuration files Setup Hibernate Environment Hibernate Architecture Hibernate Overview Hibernate 4.2 Tutorial Hibernate 4 Annotations Tutorial Hibernate 4 AnnotationSessionFactoryBean hibernate versions hibernate jndi hibernate tomcat hibernate metamodel generator hibernate entity Seam Hibernate C3P0 Hibernate hibernate shard hibernate means temporal hibernate jsf hibernate spring j2ee hibernate spring hibernate encrypted password alias_to_entity_map hibernate temporal jsf spring hibernate hibernate by example hibernate repository hibernate sample code
Ads

Hibernate Architecture

In this tutorial you will learn about the Hibernate architecture.

Here we will understand about the architecture of Hibernate using a diagram. A diagram given below is a very high level view of Hibernate architecture.

 

The above image demonstrates that a Hibernate architecture maintains a layer into which each layer isolates you from having to know the underlying API's, and also specified that there is a layer between application and the database. Hibernate produces an object called persistence object that synchronizes the data between the database and the application.

 

Above diagram explains the Hibernate architecture broadly. Use of Hibernate to persist data at first we will need an Entity class (mapped with database table) that will be instantiated by created by Hibernate, an instance of SessionFactory will be made. Factory design pattern is implemented by SessionFactory and it loads hibernate.cfg.xml file. Session object that is made from SessionFactory object is acted as a single connection with database, this connection is made by an instance of Session interface. Transaction API in Hibernate abstracts the JDBC or JTA transaction to the application.

Configuration : Configuration instance is used to provide the application to assign properties and mapped the documents when the SessionFactory is creating.

SessionFactory : SessionFactory is responsible for creating a Session instances to communicate with the database. SessionFactory object is a thread safe (immutable) and it is created once as per database.

TransactionFactory : TransactionFactory is responsible for generating a Transaction instances.

ConnectionProvider : Using ConnectionProvider Hibernate obtains a JDBC connections.

Session : Session interface is a major runtime interface between an Application and Hibernate. Main functionality of Session is to create, read, and delete operations of the mapped entity classe's instance.

Query : This interface represents a Hibernate query as Object-Oriented. An instance of Query is found by Session.createQuery().

Criteria : Criteria is used to retrieve entities by criterion objects.

Components of Hibernate Architecture

There are three main components of Hibernate Architecture :

Connection Management : This service allows database connection management in an effective manner.

Transaction Management : This service allows for executing a several database statements at a time.

Object Relational Mapping : ORM technique is used for mapping the data representation from an object-oriented model to a relational database.

When Hibernate is used with the above all three components then it is called FullCream architecture while it is called Lite architecture if there is only ORM component is used.

Advertisements

Share on Google+Share on Google+

Hibernate Architecture

Posted on: February 16, 2012 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Advertisements

Ads
 

Discuss: Hibernate Architecture  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0

Ads

 

Ads