Multiple choice technology programming languages

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

When a row might not exist, Session.get() is preferred because it returns null if not found. Session.load() throws an ObjectNotFoundException if the row doesn't exist, and it returns a proxy which can cause issues if the object doesn't actually exist.