Quote:
does it depends on lazy settings as well ? Or are you saying that when I do Session.load() never hits the database ? What if the object with specified ID does not exists ?
lazy=true means that proxies are enabled, lazy=false means that proxies are disabled. If proxies are disabled I think Session.load() will hit the database and throw an exception if it doesn't exists (Session.get() returns null instead). If proxies are enabled Session.load() will return a proxy without checking the database. If it doesn't exists you may get an error later on depending on what you do.
Using Session.get() will be like the 4-step sequence in the original post.
Using Session.load() will be like the 3-step sequence in the original post.