Hibernate version: 3.0
I'm writing an application that requires a very granular authorization model. Every attribute as well as entities within the object tree can have authorization constraints assigned to them. The onLoad event will allow me to filter at the necessary level (prior to loading for performance reasons), but in the case of eager loading, it causes the load to entirely fail because a HibernateException must be thrown to prevent the load from continuing. I'm looking for a means to prevent a load silently. Below is an example:
public class Foo {
private Boo boo;
private Goo goo;
public Boo getBoo() { ...}
public void setBoo(Boo boo) { ... }
public Goo getGoo() { ... }
public void setGoo(Goo goo) { ... }
}
In the example of above, assume that the user has authorized access to Foo entities and Goo entities, but not Boo entities. If Boo and Goo are both eager loads, when the user attempts to load Foo, I would be forced to throw a HibernateException on the onLoad event for Boo. I would prefer to silently not load the entity instead. Thoughts?
|