• +91 9723535972
  • info@interviewmaterial.com

Hibernate Interview Questions and Answers

Question - Difference between get() vs load() method in Hibernate?

Answer -

This is one of the most frequently asked Hibernate Interview Questions. The key difference between the get() and load() method is:

load(): It will throw an exception if an object with an ID passed to them is not found.
get():  Will return null.

load(): It can return proxy without hitting the database unless required.
get(): It always goes to the database.

So sometimes using load() can be faster than the get() method.

Comment(S)

Show all Coment

Leave a Comment




NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners