Ok, fixed this.
I do have a very similar problem. I've created an interceptor for a couple of types I'm using that are secured (with a custom security model). I'd like to be able to deny access to certain objects that are stored using hibernate based on properties in the class.
I've looked around and found a partial implementation of this on the wiki
here.
But this doesn't seem to work as described. When doing a query to load a number of objects of a certain type (eg: From objectA) with at least one object that violated the check the whole list comes up empty. I'd like it to return all valid typed, except the objects that threw an exception during load.
I've read on the blog that there are plans to include something like this in hibernate 2.2/3.0. I looked at the source in the CVS, but couldn't find something liek this.
Is there a way this can be done? Or will I have to put the security exclusively in a higher layer?[/url]