Hibernate Interview Questions

By | | Updated : 2020-01-11 | Viewed : 201 times

Hibernate Interview Questions

1. What is the Java Persistence API ?

Java Persistence API (JPA) is a specification for Accessing/Persisting/Manipulating data between Java Objects and Relational Database. This is introduced as a part of EJB 3.0

2. What is Hibernate Framework?

It is an ORM tool that is used for mapping Java Object with Relational Database. To persist/access/manipulate the data from Relational Databases, Hibernate will be used. It provides HQL which is very helpful for handling CRUD operations in the Database. It is a Database Independent Query Language. Hibernate provides the caching technique.

3. What are the advantages/ benefits of Hibernate over JDBC?

JDBC Hibernate
Queries are data base dependent HQL queries are database independent.
JDBC does not support for Lazy Loading Hibernate supports Lazy Loading
Developer need to write queries for Curd operations. Here we can use for Hibernate methods for CURD operations.
No support for Caching mechanism Supports Caching mechanism.
JDBC does not provide support for connection pool Hibernate provides support for connection pool
It will not support Identifier generation for primary key to insert the record It will support Identifier generation for primary key to insert the record
Caching mechanism cannot be used here. Caching mechanism can be used here
Leave A Reply