Difference between get() vs load() method in hibernate?



Difference between get() vs load() method in hibernate?..

Answer / Shameem Alam

The main difference between Hibernate's Session.get() and Session.load() methods lies in their behavior when a persistent object with the given id is not found in the database. The get() method will return null if the object is not found, whereas the load() method will throw an exception (ObjectNotFoundException).

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Hibernate Interview Questions

How do you hibernate?

1 Answers  


Is merge better than update?

1 Answers  


What is lazy and eager initialization?

1 Answers  


What is embeddable in hibernate?

1 Answers  


What is the default fetch type in hibernate?

1 Answers  


What is orm tool in hibernate?

1 Answers  


Is hibernate framework good?

1 Answers  


What is hibernate and how it works?

1 Answers  


What are the Core interfaces of Hibernate framework?

1 Answers  


What is Hibernate SessionFactory and how to configure it?

1 Answers  


How many objects are there in hibernate architecture?

1 Answers  


What is version property in hibernate?

1 Answers  


Categories