Just a little note for anyone else interested. To filter properties that are *not* in an array (i.e. don’t select from entity if foo is in bar) this is how its done in hibernate:
criteria.add(
Restrictions.not(
Restrictions.in("id", new long[] {2, 3})
)
);
And because ColdBox’s BaseORMService just proxies out to the hibernate Restrictions class, it’s easily accomplished in CB: (Showing as-is for my purposes)
ArrayAppend(
Criteria,
Restrictions.not(
Restrictions.in('user_id', JavaCast("java.lang.Integer[]", blocked_users ) )
)
);
Just be careful to check that your filter is not an empty array, otherwise Hibernate will complain about ‘()’ being bad sql grammar.