Hi:
I've been looking for methods for cancelling or stopping an entity from being loaded. The Interceptor OnLoad lets us change state but obviously wasn't intended to have enough influence to stop load operation. LifeCycle.OnLoad is similar - neither give us the ability to short-circuit the load process.
What I'm trying to do is stop the load operation if a user doesn't have appropriate permissions to see a entity based on a security check. In my current implementation I do the security check in the OnLoad method, flip a bit in each entity indicating whether access should be granted and then remove entities later, if necessary, outside the interceptor. That seems a bit too heavy-handed.
Searching this forum, I've seen similar posts asking about cancelling the delete process (
http://forum.hibernate.org/viewtopic.php?t=983056) and that type of solution may work, but I'm wondering if I'm generally thinking about the the right way or not.
Any thoughts or comments on what may be the best approach to solving this? Thanks.