I want a security filter to be applied each and every time a table is accessed.
For example, I have
Code:
@Entity class Widget{...}
and I want to filter it every time by
Code:
Hidden = false
The usual approach is
Code:
@Entity
@FilterDef(name="f")
@Filter(name="f",condition="Hidden = false")
class Widget {...}
However this fails when someone will add a relation such as
Code:
@OneToMany
.
Can I somehow force this filter to be always applied, whenever this table is accessed, by whatever means?
Similar
question in stackoverflow