I'm building a complex security mechanism to filter access to objects depending on various rights.
As part of this I want to have an initial OR
in my query that excludes all possible results from the query before the permissions allow access to certain subsets. In SQL it would look like this:
select *
from Table
where (1 = 0)
or ( /* various predicates */ )
However, I'm not sure how to create that initial 1 = 0
through the criteria API. I will probably need to create 1 = 1
at some point too but I'm assuming that will be a similar task.
How do I do this?