What is difference between get and load?
Answer / Naina Gupta
In Hibernate, 'get' method retrieves an entity from the first level cache (Session cache) if it exists. If the entity is not found in the cache, a query is executed to fetch the entity from the database. On the other hand, 'load' method fetches the data lazily from the database and returns a proxy object, which is populated only when an accessor method is called or the identifier of the entity is requested.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is the difference between load() and get() method in hibernate?
What is @id in hibernate?
How do I save in hibernate?
What is the benefit of hibernate criteria api?
How hibernate sessions work?
What is session evict in hibernate?
What are the Collection types in Hibernate?
Define the collection types in hibernate?
What is hibernate criteria?
How will you integrate hibernate with spring framework?
What is the role of session interface in hibernate?
What is @embeddedid in hibernate?