Hibernate Interview Questions and answers

The best and most important Hibernate Interview questions are mentioned below with easy to understand answers.

Hibernate Advanced Interview Questions

Yes, abstract class can have constructor, and infact it always has one. If you don't define explicitly it will have default constructor.
The construcotr is used for inheritance. When you extend a class, you need constructor in that class.
Abstraction means hiding of unnecessary compalixities from user.
Abstraction means hiding of unnecessary compalixities from user.
Abstraction means hiding of unnecessary compalixities from user.
Abstraction means hiding of unnecessary compalixities from user.
Abstraction means hiding of unnecessary compalixities from user.
Synchronization is the process of accessing shared resources by multiple threads in such a way that no resource can be accessed by multiple thread at one particular moment of time.
Synchronization is the process of accessing shared resources by multiple threads in such a way that no resource can be accessed by multiple thread at one particular moment of time.
In Java synchronization is achieved either through synchronized block or synchronized method.

Hibernate Basic Interview Questions

Java is platform independent.
  • Setter Injection
  • Constructor Injection
  • Interface Injection
Note: Spring don't support Interface injection.
  • Setter Injection
  • Constructor Injection
  • Interface Injection
Note: Spring don't support Interface injection.
Bean Facgtory Application Context
All variables of Interface are public static final by default. This is not case with Abstract class
Abstraction means hiding of unnecessary compalixities from user.
Abstraction means hiding of unnecessary compalixities from user.

IOC - Inversion Of Control

Suppose there are tow objects A and B. If object A contains object B, we say B is dependency of A
Before spring, in java the dependent object was responsible to create an object of dependency or in other words the dependent has the control of getting dependency. But now with spring this has changed. Now the control goest to dependency or spring framework. This is called 'Inversion of Control'.

Dependency Injection

The process by which spring container/framework injects the dependency into the dependent object is known as dependency injection.