How to make NOT IN statement via Restrictions
- by slavig
I used this trick:
List statuses = new ArrayList();
Criteria criteria = session.createCriteria(MessageQueue.class);
criteria.add(Restrictions.not(Restrictions.in("message_status", statuses)));
and this code creates:
...from MESSAGE_QUEUE mq where not (mq.message_status in (?, ?, ?, ?))...
but I need:
...from MESSAGE_QUEUE mq where mq.message_status NOT IN (?, ?, ?, ?)
Du you think they are equal statements?