Will keep it simple.

I have the following code...

public static List<Group> findNotInvolving(String user) {   
    return find.where()
            .ilike("task.owner.email", user)
            .findList();
}

It returns the correct list of all groups that the user IS involved in, when using .ilike().

What I need is the opposite of this though, so effectively, .notlike(blah, blah).

According to Ebeans expression list here... http://www.avaje.org/static/javadoc/pub/com/avaje/ebean/ExpressionList.html#not(com.avaje.ebean.Expression)

you can "Negate the expression (prefix it with NOT)", but I have no idea how to incorporate it, soooo any ideas??

For some reason .ne does the exact same as .eq and I've tried various other stupid things but none work.

Thanks in advance!

有帮助吗?

解决方案

You are almost done:

return find.where()
    .not(Expr.ilike("task.owner.email", user))
    .findList();
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top