Top 10 Hibernate Interview Questions

Hibernate Interview Questions and Answers are curated by Industry Experts.

1. What is Hibernate?

Hibernate refers to as a Java Framework. It enables the easy process of developing the Java application to interact with the original database.

Some Unique that Hibernate holds

  1. Hibernate is an Open-Source. Freely available to everyone across the world.
  2. Lightweight (installation & setup & queries)
  3. It is an Object Relational Mapping (ORM) tool.

2. What is ORM?

ORM stands for Object Relational Mapping Tool. It eases the process of data manipulation, data access, and data creation. ORM is a programming method that actually points the object to the database where data is actually stored.

3. How does the ORM tool access the database?

ORM internally uses the JDBC API to interact with the database.

4. Explain Architecture of Hibernate

Hibernate architecture is contains three layers as shown below

Hibernate is proficient in the existing Java API, with JDBC, Java Transaction API (JTA) and Java Naming and Directory Interface (JNDI). 

1. Configuration Object

It is the first object in Hibernate using this you create in any Hibernate application. During the application initialization, it is created. Configuration Object represents a properties or configuration file required by the Hibernate.

The Configuration Object contains the following two keys components as mentioned belwo

1.Database Connection

It is handled through one or more configuration files that are supported by Hibernate. These files include

  • i.
  • ii. hibernate.cfg.xml
2.Class Mapping Setup

It enables connection between database tables and Java Classes

hibernate interview questions - Architecture Top Level View
Hibernate Architecture

5. What are the key Components of Hibernate?

List of key components are mentioned below

  • Session
  • Session Factory
  • Query
  • Criteria
  • Transaction
  • Configuration

6. What is HQL and How it is Created?

HQL is described as a Hibernate Query Language. It created using the following syntax mentioned below


7. How is SQL Query created in Hibernate?

SQL query in Hibernate created using the following syntax


8. What is SessionFactory?

Session Factory is called Factory of Session. It provides the instance of Session. Session Factory ensures to hold the data of next level cache that actually not enabled by default.

9. What is Session?

10. What are the Core Interfaces of Hibernate?

Leave a Reply

Your email address will not be published. Required fields are marked *