Introduction to Hibernate framework


Before understanding Hibernate, let’s understand about ORM.

What is ORM ?

ORM stands for Object Relational Mapping

In any Java application, we will have objects which are representing the data that we store in the Database.

To store the data in the database, we need tables to be created in the DB and these tables are also called relational entities.

If we want to store these objects into database tables directly without writing any SQL, we need to map the class with the tables so that each object of that class can be mapped to each row in that table.

This kind of mapping between object and tables is called Object Relational Mapping(ORM).

So in ORM
class in java is referred to table in DB.
Instance of class also called objects referred to rows in the database table.
Each attribute in the class refers to each column in the table.

What is Hibernate?


Hib_overview

Hibernate internally uses JDBC API to interact with the database

Hibernate is an open source and lightweight ORM and persistence framework which allows us to map plain old java objects to relational database tables.

It facilitates the storage and retrieval of java domain objects via Object Relational Mapping.

Hibernate is created by Gavin King

Hibernate is a lightweight or non-invasive framework because it does not force the programmers to extend any classes or to implement any interfaces.

Need for Hibernate?

Hibernate has come up with many benefits over JDBC which insists us to use it.

Let’s see those benefits in the below conversation between Teacher and a Student



teach_stud1
teach_stud2
teach_stud3

About the Author

Founder of javainsimpleway.com
I love Java and open source technologies and very much passionate about software development.
I like to share my knowledge with others especially on technology 🙂
I have given all the examples as simple as possible to understand for the beginners.
All the code posted on my blog is developed,compiled and tested in my development environment.
If you find any mistakes or bugs, Please drop an email to kb.knowledge.sharing@gmail.com

Connect with me on Facebook for more updates

Share this article on