Is there a 'does not contains' functionality on a collection property of a domain object for createCriteria?
问题 I have a problem similar to this. But I want a does not contain functionality. Like I have a Post domain. A Post hasMany User. What I'd like to do, using createCriteria, is something like this: def c = Post.createCriteria() def l = c.list (max: maxVar) { notContains("users", thisUser) } I tried using ne But no luck. def l = c.list (max: maxVar) { users { ne('id', thisUser.id) } } To be clear, how can I get list of all the Post whose users field which is a collection does not contain thisUser