What is difference between session get() and load() method in hibernate?



What is difference between session get() and load() method in hibernate?..

Answer / Babita Baghel

Session's get() method returns an object instance immediately, if it exists in the session cache or retrieves the object from the database. Session's load() method only loads the primary key data from the database; the object itself will be initialized and populated with data only when you try to access its properties.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Hibernate Interview Questions

How to use union all in hibernate query?

1 Answers  


What are different states of an entity bean?

1 Answers  


What is column id?

1 Answers  


What are the best practices to follow with hibernate framework?

1 Answers  


Which type of associated entities are eagerly loaded by default?

1 Answers  


How to enable logging (log4j) in hibernate?

1 Answers  


What is the default annotation for a property in hibernate?

1 Answers  


How to integrate Hibernate with Servlet or Struts2 web applications?

1 Answers  


What is the difference between sorted collection and ordered collection, which one is better?

1 Answers  


What is the use of session.lock() in hibernate?

1 Answers  


What is the difference between jdbc and hibernate?

1 Answers  


What is jpa in hibernate?

1 Answers  


Categories