Frequently asked hibernate interview questions and answers
What is the difference between sorted and ordered collection in hibernate?
Sorted Collection: The sorted collection is a collection that is sorted using the Java collections framework. The sorting is done in the memory of JVM that is running hibernate, soon after reading the data from the database using Java Comparator The less the collection the more the
Ordered Collection: The order collections will also
Describe your favorite aspect of the Hibernate framework.
There
There are a lot of potential answers to this question. The interviewer just wants to see where your values lie.
Explain the main difference between Entity Beans and Hibernate
Entity beans are to be implemented by containers, classes, descriptors. Hibernate is just a tool that quickly
What is your least favorite aspect of the Hibernate framework?
It does a lot of things right, but I often find myself having to write boilerplate code while using Hibernate. The verbosity of the language makes my job more difficult.
Once again, the interviewer wants to see where your values lie.
Explain the difference between Hibernate and Spring.
Hibernate is an ORM tool for data
Does a Session object use a first-level cache or a second-level cache?
A Session object uses
This is a skills question, which makes sure you’ve spent enough time with the program to know its ins and outs.
Why hibernate is advantageous over Entity Beans & JDBC?
An entity bean always works under the EJB container, which allows reusing of the object external to the container. An object
Hibernate is not database dependent
How do you maintain your technical expertise?
I take continuing education classes. I also try to read up on books and magazines. Then
The interviewer wants to makes sure that you’re willing to maintain your expertise.
What is the advantage of Hibernate over
The advantages of Hibernate over JDBC are:
• Hibernate code will work well for all databases, for ex: Oracle
• No knowledge of SQL is needed because Hibernate is a set of objects and a table is treated as an object,
• Query tuning is not required in Hibernate. The query tuning is automatic in hibernate by using criteria queries, and the result of performance is at its best.
• With the support of cache of
Name an advantage of using POJOs.
POJOs — which stand for Plain Old Java Objects — are more efficient than regular java classes.
This is a skills question, which makes sure you’ve spent enough time with the program to know its ins and outs.
Source:
Hibernate interview questions and answers