codevour codevour - 1 year ago 72
Java Question

Is there something like Restrictions.eq(true, false) in Criteria API?

I need a generic

Criterion
which forces the result to zero matches.

Something like
Restrictions.eq(true, false)
?

Answer Source

I use

Restrictions.Sql("(1=0)");

:-)

(Using NHibernate in C#, assuming you are using Hibernate and Java, so I hope I used the correct names of the API).

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download