SlideShare a Scribd company logo
1 of 13
1 / 13
Hibernate Interview
Questions and Answer
2 / 13
Introduction
Hibernate is an ORM (object-relational mapping ) tool for Java
programming language. It is developed by Red Hat and was
started by Gavin King with his colleagues in 2001. The original
aim was to offer better persistence capabilities than those
offered by EJB2 (Enterprise Java Beans version 2), they wanted
to simplify the complexities and supplement certain missing
features.
3 / 13
What is Hibernate ?

Hibernate is a free software, which is distributed under GNU
Lesser General public license 2.1.

It is categorized under the Object Relational Mapping (ORM),
which features the mapping of Java classes to data tables and
mapping from Java data types to SQL data types.

It is written in Java and is JVM (Java Virtual Machine) platform
based.

Hibernate provides the data query and retrieval facilities.

It is one of the most widely used ORM tools for the Java
applications.

Hibernate is highly considered to be used in the enterprise
applications for database operations
4 / 13
What is HQL?
HQL is the acronym of Hibernate Query Language.It considers the
java objects in a similar way as that of the SQL.
It is an Object-Oriented Query Language and is independent of the
database.
5 / 13
Explain the advantages of Hibernate?
Some of the advantages of Hibernate are:

It provides Simple Querying of data.

An application server is not required to operate.

The complex associations of objects in the database can be
manipulated.

Database access is minimized with smart fetching strategies.

It manages the mapping of Java classes to database tables
without writing any code.

Properties of XML file is changed in case of any required
change in the database.
6 / 13
Why is ORM preferred over JDBC?

It allows business code access the objects rather than Database
tables.

It hides the details of SQL queries from OO logic.

It is based on JDBC “under hood”.

Dealing with database implementation is not required.

Entities are based on business concepts rather than database
structures.

It generates the automatic key and Transaction management.

Application development is faster.
7 / 13
Mention the Key components of Hibernate?
The Key components of Hibernate are:

Session: It is used to get a physical network with a database.

Transaction: It represents the unit of work with a database.

Query: It uses SQL and HQL string to retrieve the data from the
database and create objects.

Criteria: It is used create and execute object-oriented queries
and retrieve the objects.

Configuration: It represents the properties of files required by
Hibernate

Session Factory: It configures hibernate for the application using
the provided configuration file and instantiates the session
object.
8 / 13
Explain the Session in Hibernate?
It is used to get a physical connection with a database. A session
object is designed to instantiate each time an interaction is
required with the database, whereas the persistent objects are
retrieved using a session object.
The session objects are not thread-safe and must be created and
destroyed as per the requirement.
9 / 13
Explain the Transaction object in Hibernate?
It represents a unit of work with the database and most of the
RDBMS (Relational Database Management System) supports
transaction functionality.
In Hibernate, transactions are managed by an underlying
transaction manager and transaction from JDBC or JTA.
It is an optional object and the Hibernate Application do not use
this interface, instead, they handle the transactions in their
code.
10 / 13
Explain the Query object in Hibernate?
These objects use SQL and HQL string to retrieve data from the
database and create objects.
An instance of Query is used to bind query parameters, restrict
the number of results returned by the query and finally to
execute the query.
11 / 13
What is Hibernate caching?
Hibernate caches Query data and makes the application run
faster.
If used correctly, the hibernate cache can be very useful in
achieving the faster application running performance.
The main idea lying behind the cache is reducing the number of
database queries, which results in reduced throughput time of
the application.
12 / 13
What is Query level cache in Hibernate?
In hibernate, a cache query can be implemented that results in
sets and integrates closely with the second level cache.It is an
optional feature and it requires two additional cache regions
that can hold the cached query results and also the timestamps
whenever a table is updated. This is useful only for the queries
that run frequently holding the same parameters.
13 / 13
Thanks.
Reading Hibernate Interview Questions and Answer
Read More Interview Question below link:
https://www.onlineinterviewquestions.com

More Related Content

What's hot

Utilized Code Gen To Save Our Efforts In Sap Integration
Utilized Code Gen To Save Our Efforts In Sap IntegrationUtilized Code Gen To Save Our Efforts In Sap Integration
Utilized Code Gen To Save Our Efforts In Sap IntegrationGuo Albert
 
Oracle data integrator project
Oracle data integrator projectOracle data integrator project
Oracle data integrator projectAmit Sharma
 
Hibernate basics
Hibernate basicsHibernate basics
Hibernate basicsAathikaJava
 
#dbhouseparty - Spatial Technologies - @Home and Everywhere Else on the Map
#dbhouseparty - Spatial Technologies - @Home and Everywhere Else on the Map#dbhouseparty - Spatial Technologies - @Home and Everywhere Else on the Map
#dbhouseparty - Spatial Technologies - @Home and Everywhere Else on the MapTammy Bednar
 
Introduction To Corba
Introduction To CorbaIntroduction To Corba
Introduction To Corbarajianju
 
I/O & virtualization performance with a search engine based on an xml databa...
 I/O & virtualization performance with a search engine based on an xml databa... I/O & virtualization performance with a search engine based on an xml databa...
I/O & virtualization performance with a search engine based on an xml databa...lucenerevolution
 
Database@Home - Data Driven : Loading, Indexing, and Searching with Text and ...
Database@Home - Data Driven : Loading, Indexing, and Searching with Text and ...Database@Home - Data Driven : Loading, Indexing, and Searching with Text and ...
Database@Home - Data Driven : Loading, Indexing, and Searching with Text and ...Tammy Bednar
 
DB Luminous... Know Your Data
DB Luminous... Know Your DataDB Luminous... Know Your Data
DB Luminous... Know Your DataRuss Pierce
 
#dbhouseparty - Using Oracle’s Converged “AI” Database to Pick a Good but Ine...
#dbhouseparty - Using Oracle’s Converged “AI” Database to Pick a Good but Ine...#dbhouseparty - Using Oracle’s Converged “AI” Database to Pick a Good but Ine...
#dbhouseparty - Using Oracle’s Converged “AI” Database to Pick a Good but Ine...Tammy Bednar
 

What's hot (17)

Utilized Code Gen To Save Our Efforts In Sap Integration
Utilized Code Gen To Save Our Efforts In Sap IntegrationUtilized Code Gen To Save Our Efforts In Sap Integration
Utilized Code Gen To Save Our Efforts In Sap Integration
 
Midao JDBC presentation
Midao JDBC presentationMidao JDBC presentation
Midao JDBC presentation
 
Handy annotations-within-oracle-10g
Handy annotations-within-oracle-10gHandy annotations-within-oracle-10g
Handy annotations-within-oracle-10g
 
Gopi
GopiGopi
Gopi
 
Oracle data integrator project
Oracle data integrator projectOracle data integrator project
Oracle data integrator project
 
Hibernate basics
Hibernate basicsHibernate basics
Hibernate basics
 
#dbhouseparty - Spatial Technologies - @Home and Everywhere Else on the Map
#dbhouseparty - Spatial Technologies - @Home and Everywhere Else on the Map#dbhouseparty - Spatial Technologies - @Home and Everywhere Else on the Map
#dbhouseparty - Spatial Technologies - @Home and Everywhere Else on the Map
 
Hybrid provideer
Hybrid provideerHybrid provideer
Hybrid provideer
 
Introduction To Corba
Introduction To CorbaIntroduction To Corba
Introduction To Corba
 
Entity framework1
Entity framework1Entity framework1
Entity framework1
 
Spring survey
Spring surveySpring survey
Spring survey
 
RBJayaram
RBJayaramRBJayaram
RBJayaram
 
I/O & virtualization performance with a search engine based on an xml databa...
 I/O & virtualization performance with a search engine based on an xml databa... I/O & virtualization performance with a search engine based on an xml databa...
I/O & virtualization performance with a search engine based on an xml databa...
 
dvprimer-concepts
dvprimer-conceptsdvprimer-concepts
dvprimer-concepts
 
Database@Home - Data Driven : Loading, Indexing, and Searching with Text and ...
Database@Home - Data Driven : Loading, Indexing, and Searching with Text and ...Database@Home - Data Driven : Loading, Indexing, and Searching with Text and ...
Database@Home - Data Driven : Loading, Indexing, and Searching with Text and ...
 
DB Luminous... Know Your Data
DB Luminous... Know Your DataDB Luminous... Know Your Data
DB Luminous... Know Your Data
 
#dbhouseparty - Using Oracle’s Converged “AI” Database to Pick a Good but Ine...
#dbhouseparty - Using Oracle’s Converged “AI” Database to Pick a Good but Ine...#dbhouseparty - Using Oracle’s Converged “AI” Database to Pick a Good but Ine...
#dbhouseparty - Using Oracle’s Converged “AI” Database to Pick a Good but Ine...
 

Similar to Hibernate Interview Questions

Java hibernate orm implementation tool
Java hibernate   orm implementation toolJava hibernate   orm implementation tool
Java hibernate orm implementation tooljavaease
 
Hibernate Interview Questions and Answers
Hibernate Interview Questions and AnswersHibernate Interview Questions and Answers
Hibernate Interview Questions and AnswersAnuragMourya8
 
Hibernate training at HarshithaTechnologySolutions @ Nizampet
Hibernate training at HarshithaTechnologySolutions @ NizampetHibernate training at HarshithaTechnologySolutions @ Nizampet
Hibernate training at HarshithaTechnologySolutions @ NizampetJayarajus
 
Hibernate
HibernateHibernate
HibernateAjay K
 
Learn HIBERNATE at ASIT
Learn HIBERNATE at ASITLearn HIBERNATE at ASIT
Learn HIBERNATE at ASITASIT
 
What is Hibernate Framework?
What is Hibernate Framework?What is Hibernate Framework?
What is Hibernate Framework?Ducat India
 
jdbc vs hibernate.pptx
jdbc vs hibernate.pptxjdbc vs hibernate.pptx
jdbc vs hibernate.pptxYastee Shah
 
Java Hibernate Programming with Architecture Diagram and Example
Java Hibernate Programming with Architecture Diagram and ExampleJava Hibernate Programming with Architecture Diagram and Example
Java Hibernate Programming with Architecture Diagram and Examplekamal kotecha
 

Similar to Hibernate Interview Questions (20)

Hibernate in Action
Hibernate in ActionHibernate in Action
Hibernate in Action
 
What is hibernate?
What is hibernate?What is hibernate?
What is hibernate?
 
Hibernate
HibernateHibernate
Hibernate
 
What is hibernate?
What is hibernate?What is hibernate?
What is hibernate?
 
Java hibernate orm implementation tool
Java hibernate   orm implementation toolJava hibernate   orm implementation tool
Java hibernate orm implementation tool
 
Hibernate Interview Questions and Answers
Hibernate Interview Questions and AnswersHibernate Interview Questions and Answers
Hibernate Interview Questions and Answers
 
What is hibernate?
What is hibernate?What is hibernate?
What is hibernate?
 
Introduction to Hibernate
Introduction to HibernateIntroduction to Hibernate
Introduction to Hibernate
 
Hibernate training at HarshithaTechnologySolutions @ Nizampet
Hibernate training at HarshithaTechnologySolutions @ NizampetHibernate training at HarshithaTechnologySolutions @ Nizampet
Hibernate training at HarshithaTechnologySolutions @ Nizampet
 
Hibernate
HibernateHibernate
Hibernate
 
Learn HIBERNATE at ASIT
Learn HIBERNATE at ASITLearn HIBERNATE at ASIT
Learn HIBERNATE at ASIT
 
Hibernate.pdf
Hibernate.pdfHibernate.pdf
Hibernate.pdf
 
What is Hibernate Framework?
What is Hibernate Framework?What is Hibernate Framework?
What is Hibernate Framework?
 
jdbc vs hibernate.pptx
jdbc vs hibernate.pptxjdbc vs hibernate.pptx
jdbc vs hibernate.pptx
 
Hibernate 18052012
Hibernate 18052012Hibernate 18052012
Hibernate 18052012
 
Hibernate
HibernateHibernate
Hibernate
 
Java Hibernate Programming with Architecture Diagram and Example
Java Hibernate Programming with Architecture Diagram and ExampleJava Hibernate Programming with Architecture Diagram and Example
Java Hibernate Programming with Architecture Diagram and Example
 
TY.BSc.IT Java QB U6
TY.BSc.IT Java QB U6TY.BSc.IT Java QB U6
TY.BSc.IT Java QB U6
 
Hibernate training-topics
Hibernate training-topicsHibernate training-topics
Hibernate training-topics
 
Hibernate in Nutshell
Hibernate in NutshellHibernate in Nutshell
Hibernate in Nutshell
 

More from Mayank Kumar

Devops interview-questions-PDF
Devops interview-questions-PDFDevops interview-questions-PDF
Devops interview-questions-PDFMayank Kumar
 
Junit Interview Questions-ppt
Junit Interview Questions-pptJunit Interview Questions-ppt
Junit Interview Questions-pptMayank Kumar
 
Linux interview questions-ppt
Linux interview questions-pptLinux interview questions-ppt
Linux interview questions-pptMayank Kumar
 
Struts interview-questions-ppt
Struts interview-questions-pptStruts interview-questions-ppt
Struts interview-questions-pptMayank Kumar
 
PHP Interview Questions-ppt
PHP Interview Questions-pptPHP Interview Questions-ppt
PHP Interview Questions-pptMayank Kumar
 
Core Java interview questions-ppt
Core Java interview questions-pptCore Java interview questions-ppt
Core Java interview questions-pptMayank Kumar
 
Tableau interview questions-ppt
 Tableau interview questions-ppt Tableau interview questions-ppt
Tableau interview questions-pptMayank Kumar
 

More from Mayank Kumar (7)

Devops interview-questions-PDF
Devops interview-questions-PDFDevops interview-questions-PDF
Devops interview-questions-PDF
 
Junit Interview Questions-ppt
Junit Interview Questions-pptJunit Interview Questions-ppt
Junit Interview Questions-ppt
 
Linux interview questions-ppt
Linux interview questions-pptLinux interview questions-ppt
Linux interview questions-ppt
 
Struts interview-questions-ppt
Struts interview-questions-pptStruts interview-questions-ppt
Struts interview-questions-ppt
 
PHP Interview Questions-ppt
PHP Interview Questions-pptPHP Interview Questions-ppt
PHP Interview Questions-ppt
 
Core Java interview questions-ppt
Core Java interview questions-pptCore Java interview questions-ppt
Core Java interview questions-ppt
 
Tableau interview questions-ppt
 Tableau interview questions-ppt Tableau interview questions-ppt
Tableau interview questions-ppt
 

Recently uploaded

SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 

Recently uploaded (20)

SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 

Hibernate Interview Questions

  • 1. 1 / 13 Hibernate Interview Questions and Answer
  • 2. 2 / 13 Introduction Hibernate is an ORM (object-relational mapping ) tool for Java programming language. It is developed by Red Hat and was started by Gavin King with his colleagues in 2001. The original aim was to offer better persistence capabilities than those offered by EJB2 (Enterprise Java Beans version 2), they wanted to simplify the complexities and supplement certain missing features.
  • 3. 3 / 13 What is Hibernate ?  Hibernate is a free software, which is distributed under GNU Lesser General public license 2.1.  It is categorized under the Object Relational Mapping (ORM), which features the mapping of Java classes to data tables and mapping from Java data types to SQL data types.  It is written in Java and is JVM (Java Virtual Machine) platform based.  Hibernate provides the data query and retrieval facilities.  It is one of the most widely used ORM tools for the Java applications.  Hibernate is highly considered to be used in the enterprise applications for database operations
  • 4. 4 / 13 What is HQL? HQL is the acronym of Hibernate Query Language.It considers the java objects in a similar way as that of the SQL. It is an Object-Oriented Query Language and is independent of the database.
  • 5. 5 / 13 Explain the advantages of Hibernate? Some of the advantages of Hibernate are:  It provides Simple Querying of data.  An application server is not required to operate.  The complex associations of objects in the database can be manipulated.  Database access is minimized with smart fetching strategies.  It manages the mapping of Java classes to database tables without writing any code.  Properties of XML file is changed in case of any required change in the database.
  • 6. 6 / 13 Why is ORM preferred over JDBC?  It allows business code access the objects rather than Database tables.  It hides the details of SQL queries from OO logic.  It is based on JDBC “under hood”.  Dealing with database implementation is not required.  Entities are based on business concepts rather than database structures.  It generates the automatic key and Transaction management.  Application development is faster.
  • 7. 7 / 13 Mention the Key components of Hibernate? The Key components of Hibernate are:  Session: It is used to get a physical network with a database.  Transaction: It represents the unit of work with a database.  Query: It uses SQL and HQL string to retrieve the data from the database and create objects.  Criteria: It is used create and execute object-oriented queries and retrieve the objects.  Configuration: It represents the properties of files required by Hibernate  Session Factory: It configures hibernate for the application using the provided configuration file and instantiates the session object.
  • 8. 8 / 13 Explain the Session in Hibernate? It is used to get a physical connection with a database. A session object is designed to instantiate each time an interaction is required with the database, whereas the persistent objects are retrieved using a session object. The session objects are not thread-safe and must be created and destroyed as per the requirement.
  • 9. 9 / 13 Explain the Transaction object in Hibernate? It represents a unit of work with the database and most of the RDBMS (Relational Database Management System) supports transaction functionality. In Hibernate, transactions are managed by an underlying transaction manager and transaction from JDBC or JTA. It is an optional object and the Hibernate Application do not use this interface, instead, they handle the transactions in their code.
  • 10. 10 / 13 Explain the Query object in Hibernate? These objects use SQL and HQL string to retrieve data from the database and create objects. An instance of Query is used to bind query parameters, restrict the number of results returned by the query and finally to execute the query.
  • 11. 11 / 13 What is Hibernate caching? Hibernate caches Query data and makes the application run faster. If used correctly, the hibernate cache can be very useful in achieving the faster application running performance. The main idea lying behind the cache is reducing the number of database queries, which results in reduced throughput time of the application.
  • 12. 12 / 13 What is Query level cache in Hibernate? In hibernate, a cache query can be implemented that results in sets and integrates closely with the second level cache.It is an optional feature and it requires two additional cache regions that can hold the cached query results and also the timestamps whenever a table is updated. This is useful only for the queries that run frequently holding the same parameters.
  • 13. 13 / 13 Thanks. Reading Hibernate Interview Questions and Answer Read More Interview Question below link: https://www.onlineinterviewquestions.com