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

Hibernate

Hibernate is a lightweight, open-source Java framework that simplifies database interactions through Object Relational Mapping (ORM) and implements the Java Persistence API (JPA). It offers advantages such as fast performance, database-independent queries, automatic table creation, and simplified complex joins. The document also outlines the steps to create a simple Hibernate application using Eclipse IDE.

Uploaded by

Candy Man
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)
3 views

Hibernate

Hibernate is a lightweight, open-source Java framework that simplifies database interactions through Object Relational Mapping (ORM) and implements the Java Persistence API (JPA). It offers advantages such as fast performance, database-independent queries, automatic table creation, and simplified complex joins. The document also outlines the steps to create a simple Hibernate application using Eclipse IDE.

Uploaded by

Candy Man
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/ 6

Hibernate

This hibernate provides in-depth concepts of Hibernate Framework with


simplified examples. It was started in 2001 by Gavin King as an alternative
to EJB2 style entity bean.

Hibernate Framework
Hibernate is a Java framework that simplifies the development of Java
application to interact with the database. It is an open source, lightweight,
ORM (Object Relational Mapping) tool. Hibernate implements the
specifications of JPA (Java Persistence API) for data persistence.
ORM Tool
An ORM tool simplifies the data creation, data manipulation and data access. It is a
programming technique that maps the object to the data stored in the database.

The ORM tool internally uses the JDBC API to interact


with the database.
What is JPA?
Java Persistence API (JPA) is a Java specification that provides certain functionality and
standard to ORM tools. The javax.persistence package contains the JPA classes and
interfaces.

Advantages of Hibernate Framework


Following are the advantages of hibernate framework:
1) Open Source and Lightweight
Hibernate framework is open source under the LGPL license and lightweight.

2) Fast Performance
The performance of hibernate framework is fast because cache is internally used in hibernate
framework. There are two types of cache in hibernate framework first level cache and second
level cache. First level cache is enabled by default.

3) Database Independent Query


HQL (Hibernate Query Language) is the object-oriented version of SQL. It generates the
database independent queries. So you don't need to write database specific queries. Before
Hibernate, if database is changed for the project, we need to change the SQL query as well
that leads to the maintenance problem.
4) Automatic Table Creation
Hibernate framework provides the facility to create the tables of the database automatically.
So there is no need to create tables in the database manually.
5) Simplifies Complex Join
Fetching data from multiple tables is easy in hibernate framework.
6) Provides Query Statistics and Database Status
Hibernate supports Query cache and provide statistics about query and database status.
Hibernate Example using XML in Eclipse

Here, we are going to create a simple example of hibernate application using eclipse
IDE. For creating the first hibernate application in Eclipse IDE, we need to follow the
following steps:

• Create the java project


• Add jar files for hibernate
• Create the Persistent class
• Create the mapping file for Persistent class
• Create the Configuration file
• Create the class that retrieves or stores the persistent object
• Run the application

You might also like