0% found this document useful (0 votes)
6 views

Hibernate

Hibernate is an open-source Object-Relational Mapping (ORM) framework for Java that simplifies the process of mapping Java classes to database tables. It provides advantages such as easy configuration, support for various databases, and a layered architecture that includes components like SessionFactory and Session for managing database interactions. Hibernate also supports multiple technologies and minimizes database access through efficient fetching strategies.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Hibernate

Hibernate is an open-source Object-Relational Mapping (ORM) framework for Java that simplifies the process of mapping Java classes to database tables. It provides advantages such as easy configuration, support for various databases, and a layered architecture that includes components like SessionFactory and Session for managing database interactions. Hibernate also supports multiple technologies and minimizes database access through efficient fetching strategies.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Hibernate – Overview

Hibernate is an Object-Relational Mapping (ORM)


solution for JAVA. It is an open source persistent
framework created by Gavin King in 2001. It is a
powerful, high performance Object-Relational
Persistence and Query service for any Java
Application.
Hibernate maps Java classes to database tables and
from Java data types to SQL data types
Hibernate sits between traditional Java objects and
database server to handle all the works in persisting
those objects based on the appropriate O/R
mechanisms and patterns.
Hibernate Advantages

• Hibernate takes care of mapping Java classes


to database tables using XML files and
without writing any line of code.
• Provides simple APIs for storing and
retrieving Java objects directly to and from
the database.
• If there is change in the database or in any
table, then you need to change the XML file
properties only.
• Abstracts away the unfamiliar SQL types
and provides a way to work around familiar
Java Objects.
• Hibernate does not require an application
server to operate.
• Manipulates Complex associations of objects
of your database.
• Minimizes database access with smart
fetching strategies.
• Provides simple querying of data.
Supported Databases
Hibernate supports almost all the major RDBMS.
Following is a list of few of the database engines
supported by Hibernate −
• HSQL Database Engine
• DB2/NT
• MySQL
• PostgreSQL
• FrontBase
• Oracle
• Microsoft SQL Server Database
• Sybase SQL Server

Supported Technologies
Hibernate supports a variety of other technologies,
including −
• XDoclet Spring
• J2EE
• Eclipse plug-ins
• Maven

Hibernate Architecture
The Hibernate architecture includes many
objects such as persistent object, session
factory, transaction factory, connection
factory, session, transaction etc.

The Hibernate architecture is categorized in


four layers.
o Java application layer
o Hibernate framework layer
o Backhand api layer
o Database layer
Let's see the diagram of hibernate architecture
This is the high level architecture of Hibernate
with mapping file and configuration file.
Hibernate framework uses many objects such
as session factory, session, transaction etc.
alongwith existing Java API such as JDBC
(Java Database Connectivity), JTA (Java
Transaction API) and JNDI (Java Naming
Directory Interface).
Elements of Hibernate Architecture

For creating the first


hibernate application,
we must know the
elements of Hibernate
architecture. They are as
follows:
SessionFactory

The SessionFactory is a factory of session and


client of ConnectionProvider. It holds second
level cache (optional) of data. The
org.hibernate.SessionFactory interface
provides factory method to get the object of
Session.
Session

The session object provides an interface


between the application and data stored in the
database. It is a short-lived object and wraps
the JDBC connection. It is factory of
Transaction, Query and Criteria. It holds a
first-level cache (mandatory) of data. The
org.hibernate.Session interface provides
methods to insert, update and delete the
object. It also provides factory methods for
Transaction, Query and Criteria.
Transaction

The transaction object specifies the atomic unit


of work. It is optional. The
org.hibernate.Transaction interface provides
methods for transaction management.
ConnectionProvider

It is a factory of JDBC connections. It abstracts


the application from DriverManager or
DataSource. It is optional.
TransactionFactory

It is a factory of Transaction. It is optional

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy