How to query flags stored as enum in NHibernate
- by SztupY
How to do either a HQL or a Criteria search (the latter is preferred) involving an enum that is used as flags. In other words, I have a persisted enum property that stores some kind of flags. I want to query all the records that have one of these flags set. Using Eq won't work of course because that will only be true, if that is the only flag set.
Solving this using the Criteria API would be the best, but if this is only doable using HQL that is good too.