I need a generic Criterion
which forces the result to zero matches.
Something like Restrictions.eq(true, false)
?
I need a generic Criterion
which forces the result to zero matches.
Something like Restrictions.eq(true, false)
?
I use in NHibernate (C#):
Restrictions.Sql("(1=0)");
or in Hibernate (Java):
Restrictions.sqlRestriction("(1=0)");
:-)
Restrictions.sqlRestriction("(1=0)")
seems to do the trick. –
Anagnorisis In Hibernate you might use sqlRestriction
:
I used below code in hibernate and it worked for me:
Restrictions.sqlRestriction("1=0")
© 2022 - 2024 — McMap. All rights reserved.