Difference between load( ) vs get( ) in Hibernate
The following Hibernate code snippet retrieves a User object from the database:
load()
--------------
1). Only use the
2).
3).
Read more..
load()
--------------
1). Only use the
load()method if you are sure that the object exists.2).
load() method will throw an exception if the unique id is not found in the database.3).
load() just returns a proxy by default and database won’t be hit until the proxy is first invoked.
