I have written an interceptor to log onLoad
events, but I would like to be able to differentiate loads from fetches--namely, whether Hibernate had to fetch the entity from the database, or if it simply loaded it from one of its caches.
The reason I can't use Hibernate statistics is because I would like a more fine-grained analysis of what method is causing which load/fetch/query, which is why I am using an interceptor. So I guess my question is, how can I differentiate loads from fetches using an interceptor?
Thanks in advance!