Hibernate

Object-Relational Mapping Introduction

The technique to convert data between object model and relational database is known as object-relational mapping (ORM mapping). When we are considering a programming language, there the business logic works on objects but when it comes to the tables in relational database, they are not objects.

Object oriented programming language uses classes and relational database uses tables. So, the bridging of gap between Object oriented model and Relational model is known as Object Relational Mapping(ORM).

Object-Relational Impedance Mismatch

Object-Relational Impedance Mismatch is a way of saying that object models and relational models do not work very well together. RDBMSs represent data in a tabular format whereas object-oriented languages, such as Java, represent it as an interconnected graph of objects.

Hibernate Introduction

While programming language like Java is object-oriented, which represents data as interconnected graph of objects, relational database, on the contrary, represents data in tabular format (like spreadsheet). You need to tackle the mismatch between object model and relational model. This can be done by using ORM mapping tool which will provide a simple API for storing and retrieving Java objects directly from database.

An ORM tool simplifies the data creation, data manipulation and data access.

Hibernate is an open source, lightweight, ORM (Object Relational Mapping) tool. Hibernate framework simplifies the development of java application to interact with the database.

  • The ORM tool internally uses the JDBC API to interact with the database.

orm

Hibernate v/s JDBC

hibernate-vs-jdbc

Hibernate Architecture

high-level-hibernate-architecture
comprehensive-hibernate-architecture