Introduction to Hibernate Framework

Hibernate is a framework that help you easily map Java classes to database tables (and Java fields to DB columns, Java data types to DB data types etc.), without writing the usual create, select, update and delete sql queries.

 

Object Relational Mapping (ORM)

Hibernate is an ORM framework. Hibernate help you map your object model to a relational model. 

In object model, objects are the main components of the system, and they are related to other classes via inheritance relationships. An object has an identity through its state, and behaviour. 

A relational model defines the structure of data. In relational model, data is organized in the form of tables, and different tables are associated by means of referential integrity constraints. 

Compared to traditional techniques of exchange between an object-oriented language and a relational database, ORM often reduces the amount of code that needs to be written. 

 

Hibernate and Java Persistence API

The Java Persistence API (JPA) is a Java application programming interface specification that describes the management of relational data, especially persistance.

Hibernate also implements Java Persistence API

By using JPA, it makes possible for us to change hibernate with any other framework that implements JPA easily in future with minimal changes. 

 

Overview of important features of Hibernate framework

  1. The mappings between java classes and SQL constructs can be configured in xml files or using annotations.

  2. Hibernate generates the required SQL calls and also attempts to relieve the developer from manual result set handling and object conversion.

  3. Hibernate also keep the application portable to all supported SQL databases. 

  4. Hibernate also provides explicit data query and retrieval facilities, if needed. 

  5. Hibernate also has othe components like Hibernate Search, Hibernate Validator, and Hibernate OGM1 (No SQL).

Tags: 

Search the Web

Custom Search

Searches whole web. Use the search in the right sidebar to search only within javajee.com!!!