Multiple choice technology web technology

If you are not certain that a matching row exists in the database then which method is the best ?

  1. Session.load();

  2. Session.get();

  3. Session.fetch();

  4. None of the above

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Session.get() returns null if no matching row exists, while Session.load() throws an ObjectNotFoundException. There is no Session.fetch() method in Hibernate. Use get() when existence is uncertain.