This is for all those who are just beginning their journey with Java and stumbled upon Hibernate Framework.
So, we shall cover the following topics today.
- What is Hibernate Framework?
- Architecture and it’s component.
What is Hibernate Framework?
Simple Answer: Hibernate is an open source ORM (Object Relational Mapping) tool.
Detailed Answer: Any applications that are dependent on data requires a means of communicating with the database for any of the Create, Read, Update or Delete (CRUD) operations. Java provides a way to connect to database and perform these operations via JDBC and Hibernate.
Let’s discuss on the latter part, i.e., Hibernate.
Hibernate is the implementation of Java Persistence API, commonly called the JPA. It aids in communicating with the database by creating a session.
Architecture and it’s components.
Hibernate consists of two main components
- Session Factory: As the name indicates it is the factory from where the session objects are created. To create a session for the database connection, first we need to create a session factory object.
- Session: This is the object that connects the application to the database. It aids in CRUD operations.