Hibernate Interview Questions Preparation Course
3.9 (8 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
474 students enrolled
Wishlisted Wishlist

Please confirm that you want to add Hibernate Interview Questions Preparation Course to your Wishlist.

Add to Wishlist

Hibernate Interview Questions Preparation Course

Get success in Hibernate interview!
3.9 (8 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
474 students enrolled
Last updated 8/2017
English
Current price: $10 Original price: $200 Discount: 95% off
5 hours left at this price!
30-Day Money-Back Guarantee
Includes:
  • 1.5 hours on-demand video
  • 4 Articles
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
What Will I Learn?
  • Understand Hibernate concepts
  • Learn Hibernate Interview Questions
  • Best practices of Hibernate
  • Tricky questions on Hibernate
  • Gain deep Hibernate knowledge
  • Demand higher salary or promotion based on the knowledge gained!
View Curriculum
Requirements
  • Basic Software knowledge
  • Familiar with Hibernate
  • Internet access
Description

Hibernate is one of the most popular framework for enterprise applications implemented in Java. Big companies like Amazon, Netflix, Google etc use Hibernate based architecture. This course is designed to help you achieve your goals in Hibernate field. Software Engineers with Hibernate knowledge may get more salary than others with similar qualifications without Hibernate knowledge.

In this course, you will learn how to handle interview questions on Hibernate framework in Software Design and Development. I will explain you the important concepts of Hibernate architecture.

You will also learn the benefits and use cases of Hibernate in this course. 

What is the biggest benefit of this course to me?

Finally, the biggest benefit of this course is that you will be able to demand higher salary in your next job interview.

It is good to learn Hibernate for theoretical benefits. But if you do not know how to handle interview questions on Hibernate, you can not convert your Hibernate knowledge into higher salary.

What are the topics covered in this course?

We cover a wide range of topics in this course. We have questions on Hibernate best practices, Security. tricky questions etc.

How will this course help me?

By attending this course, you do not have to spend time searching the Internet for Hibernate interview questions. We have already compiled the list of the most popular and the latest Hibernate Interview questions. 

Are there answers in this course?

Yes, in this course each question is followed by an answer. So you can save time in interview preparation.

What is the best way of viewing this course?

You have to just watch the course from beginning to end. Once you go through all the videos, try to answer the questions in your own words. Also mark the questions that you could not answer by yourself. Then, in second pass go through only the difficult questions. After going through this course 2-3 times, you will be well prepared to face a technical interview in Hibernate framework.

What is the level of questions in this course?

This course contains questions that are good for a Fresher to an Architect level. The difficulty level of question varies in the course from a Fresher to an Experienced professional.

What happens if Hibernate technology changes in future?

From time to time, we keep adding more questions to this course. Our aim is to keep you always updated with the latest interview questions on Hibernate.


What are the sample questions covered in this course?

Sample questions covered in this course are as follows:

  1. What is Hibernate framework?
  2. What is an Object Relational Mapping (ORM)?
  3. What is the purpose of Configuration Interface in Hibernate?
  4. What is Object Relational Impedance Mismatch?
  5. What are the main problems of Object Relational Impedance Mismatch?
  6. What are the key characteristics of Hibernate?
  7. Can you tell us about the core interfaces of Hibernate framework?
  8. How will you map the columns of a DB table to the properties of a Java class in Hibernate?
  9. Does Hibernate make it mandatory for a mapping file to have .hbm.xml extension?
  10. What are the steps for creating a SessionFactory in Hibernate?
  11. Why do we use POJO in Hibernate?
  12. What is Hibernate Query Language (HQL)?
  13. How will you call a stored procedure in Hibernate?
  14. What is Criteria API in Hibernate?
  15. Why do we use HibernateTemplate?
  16. How can you see SQL code generated by Hibernate on console?
  17. What are the different types of collections supported by Hibernate?
  18. What is the difference between session.save() and session.saveOrUpdate() methods in Hibernate?
  19. What are the advantages of Hibernate framework over JDBC?
  20. How can we get statistics of a SessionFactory in Hibernate?
  21. What is the Transient state of an object in Hibernate?
  22. What is the Detached state of an object in Hibernate?
  23. What is the use of Dirty Checking in Hibernate?
  24. What is the purpose of Callback interface in Hibernate?
  25. What are the different ORM levels in Hibernate?
  26. What are the different ways to configure a Hibernate application?
  27. What is Query Cache in Hibernate?
  28. What are the different types of Association mappings supported by Hibernate?
  29. What are the different types of Unidirectional Association mappings in Hibernate?
  30. What is Unit of Work design pattern?
  31. In Hibernate, how can an object go in Detached state?
  32. How will you order the results returned by a Criteria in Hibernate?
  33. How does Example criterion work in Hibernate?
  34. How does Transaction management work in Hibernate?
  35. How can we mark an entity/collection as immutable in Hibernate?
  36. What are the different options to retrieve an object from database in Hibernate?
  37. How can we auto-generate primary key in Hibernate?
  38. How will you re-attach an object in Detached state in Hibernate?
  39. What is the first level of cache in Hibernate?
  40. What are the different second level caches available in Hibernate?
  41. Which is the default transaction factory in Hibernate?
  42. What are the options to disable second level cache in Hibernate?
  43. What are the different fetching strategies in Hibernate?
  44. What is the difference between Immediate fetching and Lazy collection fetching?
  45. What is ‘Extra lazy fetching’ in Hibernate?
  46. How can we check is a collection is initialized or not under Lazy Initialization strategy?
  47. What are the different strategies for cache mapping in Hibernate?
  48. What is the difference between a Set and a Bag in Hibernate?
  49. How can we monitor the performance of Hibernate in an application?
  50. How can we check if an Object is in Persistent, Detached or Transient state in Hibernate?
  51. What is ‘the inverse side of association’ in a mapping?
  52. What is ORM metadata?
  53. What is the difference between load() and get() method in Hibernate?
  54. When should we use get() method or load() method in Hibernate?
  55. What is a derived property in Hibernate?
  56. How can we use Named Query in Hibernate?
  57. What are the two locking strategies in Hibernate?
  58. What is the use of version number in Hibernate?
  59. What is the use of session.lock() method in Hibernate?
  60. What inheritance mapping strategies are supported by Hibernate?


Who is the target audience?
  • Fresher, Software Engineer, Sr. Software Engineer, Member Technical Staff, Expert
  • Software Architect, Development Manager, Director
  • Anyone who wants to appear in Hibernate interview
  • People interested in going up in career!!
Students Who Viewed This Course Also Viewed
Curriculum For This Course
39 Lectures
01:39:44
+
Why should you learn Hibernate?
3 Lectures 04:41

How to master Hibernate Interview Questions?
00:30

Disclaimer
00:38
+
Hibernate Interview Questions - Part 1
5 Lectures 15:57


Q.    What is Hibernate framework?

Hibernate is a popular Object Relational Mapping (ORM) framework of Java. It helps in mapping the Object Oriented Domain model to Relational Database tables.

Hibernate is a free software distributed under GNU license.

Hibernate also provides implementation of Java Persistence API (JPA).

In simple words, it is a framework to retrieve and store data from database tables from Java.

Preview 03:06



What are the key characteristics of Hibernate?
03:27

Can you tell us about the core interfaces of Hibernate framework?
03:11

Hibernate Interview Questions Quiz - 1
5 questions
+
Hibernate Interview Questions - Part 2
5 Lectures 13:08

Q.    How will you map the columns of a DB table to the properties of a Java class in Hibernate?

We can map the class properties and table columns by using one of the two ways:

XML: We can map the column of a table to the property of a class in XML file. It is generally with extension hbm.xml

Annotation: We can also use annotations @Entity and @Table to map a column to the property of a class.


Q.   Does Hibernate make it mandatory for a mapping file to have .hbm.xml extension?

No. It is a convention to have.hbm.xml extension in the name of a mapping file. It is not a requirement enforced by Hibernate. We can use any other extension of our convenience for this.

How will you map the columns of a DB table to the properties of a Java class?
02:04

Q.    What are the steps for creating a SessionFactory in Hibernate?

Steps to create a SessionFactory in Hibernate are:

Configuration: First create a Configuration object. This will refer to the path of configuration file.

Resource: Add config file resource to Configuration object.

Properties: Set properties in the Configuration object.

SessionFactory: Use Configuration object to build SessionFactory.

Egg.

Configuration config = new Configuration();

config.addResource(“testInstance/configuration.hbm.xml”);

config.setProperties( System.getProperties() );

SessionFactory sessions = config.buildSessionFactory();

What are the steps for creating a SessionFactory in Hibernate?
02:14

Q.    Why do we use POJO in Hibernate?

POJO stands for Plain Old Java Objects. A POJO is java bean with getter and setter methods for each property of the bean.

It is a simple class that encapsulates an object’s properties and provides access through setters and getters.

Some of the reasons for using POJO in Hibernate are:

POJO emphasizes the fact that this class is a simple Java class, not a heavy class like EJB.

POJO is a well-constructed class, so it works well with Hibernate proxies.

POJO also comes with a default constructor that makes it easier to persist with a default constructor.

Why do we use POJO in Hibernate?
02:28

Q.    What is Hibernate Query Language (HQL)?

Hibernate Query Language is also known as HQL. It is an Object Oriented language. But it is similar to SQL.

HQL works well with persistent objects and their properties. HQL does not work on database tables.

HQL queries are translated into native SQL queries specific to a database.

HQL supports direct running of native SQL queries also. But it creates an issue in Database portability.

What is Hibernate Query Language (HQL)?
03:03

Q.    How will you call a stored procedure in Hibernate?

Hibernate supports executing not only simple queries but also stored procedure of database. There are three ways to call a stored procedure in Hibernate:

XML mapping file:

We can declare the store procedure inside XML Mapping file. We can call it with getNamedQuery().


Native SQL: We can use Native SQL to call a store procedure query directly. In this example GetEmployees() stored procedure is being called.


Query query = session.createSQLQuery(

            "CALL GetEmployees(:employeeId)")


Use annotation:

We can also mark out stored procedure with @NamedNativeQueries annotation.

//Employee.java

@NamedNativeQueries({


How will you call a stored procedure in Hibernate?
03:19

Hibernate Interview Questions Quiz - 2
5 questions
+
Hibernate Interview Questions - Part 3
5 Lectures 12:52
What is Criteria API in Hibernate?
02:33

What are the different types of collections supported by Hibernate?
02:14

What are the advantages of Hibernate framework over JDBC?
03:22

What is the Transient state of an object in Hibernate?
02:28


Q.    What is the use of Dirty Checking in Hibernate?

Dirty Checking is very useful feature of Hibernate for write to database operations. Hibernate monitors all the persistent objects for any changes. It can detect if an object has been modified or not.

By Dirty Checking, only those fields of an object are updated that require any change in them. It reduces the time-consuming database write operations.

Q.   What is the purpose of Callback interface in Hibernate?

Callback interface in Hibernate is mainly used for receiving notifications of different events from an object.

Egg. We can use Callback to get the notification when an object is loaded into or removed from database.

What is the use of Dirty Checking in Hibernate?
02:15

Hibernate Interview Questions Quiz - 3
5 questions
+
Hibernate Interview Questions - Part 4
5 Lectures 13:30
What are the different ORM levels in Hibernate?
03:05


Q.    What are the different ways to configure a Hibernate application?

There are mainly two ways to configure Hibernate application:

XML based: We can define the Hibernate configuration in an XML file like ibernate.cfg.xml file

Programming based: We can also use code logic to configure Hibernate in our application.

Q.   What is Query Cache in Hibernate?

Hibernate provides Query Cache to improve the performance of queries that run multiple times with same parameters.

At times Query Caching can reduce the performance of Transactional processing. By default Query Cache is disabled in Hibernate.

It has to be used based on the benefits gained by it in performance of the queries in an application.

What are the different ways to configure a Hibernate application?
02:14


Q.    What are the different types of Association mappings supported by Hibernate?

Hibernate supports following four types of Association mappings:

Unidirectional association: This kind of association works in only one direction.

Unidirectional association with join tables

Bidirectional association: This kind of association works in both directions.

Bidirectional association with join tables

Q.   What are the different types of Unidirectional Association mappings in Hibernate?

In Hibernate there can be following three types of Unidirectional Association mappings:

Many to one

One to one

One to many

What are the different types of Association mappings supported by Hibernate?
02:55

What is Unit of Work design pattern?
02:47

How will you order the results returned by a Criteria in Hibernate?
02:29

Hibernate Interview Questions Quiz - 4
5 questions
+
Hibernate Interview Questions - Part 5
5 Lectures 11:24
How does Transaction management work in Hibernate?
02:28


Q.    What are the different options to retrieve an object from database in Hibernate?

In Hibernate, we can use one of the following options to retrieve objects from database:

Identifier: We can use load() or get() method and pass the identifier like primary key to fetch an object from database.

HQL: We can create a HQL query and get the object after executing the query.

Criteria API: We can use Criteria API to create the search conditions for getting the objects from database.

Native SQL: We can write native SQL query for a database and just execute it to get the data we want and convert it into desired object.

What are the different options to retrieve an object from database in Hibernate?
02:16

How can we auto-generate primary key in Hibernate?
02:19

What are the different second level caches available in Hibernate?
02:07

What are the different fetching strategies in Hibernate?
02:14

Hibernate Interview Questions Quiz - 5
5 questions
+
Hibernate Interview Questions - Part 6
5 Lectures 12:23
What is the difference between Immediate and Lazy collection fetching?
02:36

What are the different strategies for cache mapping in Hibernate?
02:15

Q.    What is the difference between a Set and a Bag in Hibernate?

A Bag in Hibernate is an unordered collection. It can have duplicate elements. When we persist an object in a bag, there is no guarantee that bag will maintain any order.

A Set in Hibernate can only store unique objects. If we add the same element to set second time, it just replaces the old one. By default a Set is unordered collection in Hibernate.


What is the difference between a Set and a Bag in Hibernate?
02:31

How can we monitor the performance of Hibernate in an application?
02:36

What is ‘the inverse side of association’ in a mapping?
02:25
+
Hibernate Interview Questions - Part 7
4 Lectures 11:13

Q.    What is the difference between load() and get() method in Hibernate?

In Hibernate, load() and get() methods are quite similar in functionality.

The main difference is that load() method will throw an ObjectNotFoundException if row corresponding to an object is not found in the database.

On the other hand, get() method returns null value when an object is not found in the database.

It is recommended that we should use load() method only when we are sure that object exists in database.

Q.   When should we use get() method or load() method in Hibernate?

As a thumb rule we can follow these guidelines:

We should use get() method when we want to load an object.

We should use load() method when we need a reference to an object without running extra SQL queries.


What is the difference between load() and get() method in Hibernate?
02:08

What is a derived property in Hibernate?
02:10

What are the two locking strategies in Hibernate?
03:50

What is the use of session.lock() method in Hibernate?
03:05
+
Bonus Section!
2 Lectures 04:50
Bonus Lecture: What next?
02:06

Test Your Knowledge?
02:44
About the Instructor
KnowledgePowerhouse !
3.7 Average rating
232 Reviews
3,730 Students
18 Courses
Top most career courses! 18 Courses, 3300+ students!

I am a Software Architect with expertise in Cloud Computing, Amazon Web Services, Microservices, Data Science, Hadoop, Spark, Machine Learning and Java architecture. Learning, using and sharing Technology is my passion.

I have built systems that are running enterprise software of companies across the world. I have gained a lot of knowledge by working hands-on on these large scale software projects.

With these courses I aim to share my knowledge with the future Software Engineers, Developers, Leaders and Architects . 

I am sure the knowledge in these courses can give you extra power to win in life.

All the best!!