Ok, tested with PreLoad and PostLoad event listeners, and none fire in case of criteria query. Basically I need a consistent mechanism to intercept when a object is not found within hibernate framework ( to fit in with the legacy data model, don't ask why.. ;) ).
The custom load event listener ( extending from DefaultLoadEventListener ), seems to work for HQL query as well as Session.load() and Session.get() API. The only one I'm having trouble with is the criteria query.
Looking through the source, it doesn't seem like any EventListeners are fired during the criteria query. Your help will be greatly appreciated.
Thanks,
-Sanket
|