Expert |
|
Joined: Tue Sep 16, 2003 4:06 pm Posts: 318 Location: St. Petersburg, Russia
|
I think it is because find() does not throw exception in the case when object with given ID does not exist.
Of course, you can catch exception and handle it appropriately, but "appropriately" here means:
"If the Session throws an exception (including any SQLException), you should immediately rollback the transaction, call Session.close() and discard the Session instance." (7.9.4. Exception handling)
PS: With Hibernate 2.1 there is even better method - session.get()
|
|