I've always liked the criteria, but I don't like to use HQL.
The in method provided in the property class has three:
Public criterion in (Collection values)
Public criterion in (object[] values)
Public criterion in (Detachedcriteria subselect)
However, the corresponding three notin methods are not provided, providing only one:
Public criterion Notin (Detachedcriteria subselect)
It seems that if you use the property method, you can only create a subquery again.
However, we can view the restrictions class again. Depressed, restrictions more outrageous, provided only two in methods, and did not provide Notin method
public static criterion in (String PropertyName, object[] values)
public static criterion in (String PropertyName, Collection values)
So, what to do. I've always hated using HQL.
After a long exploration, restrictions found that there is a not method, there, you can put in the outer set a not, soon it can be:).
The example code for the final workaround is as follows:
Criteria.add (Restrictions.not (restrictions.in ("id", callbackids));