Question

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!

Was it helpful?

Solution

You are almost done:

return find.where()
    .not(Expr.ilike("task.owner.email", user))
    .findList();
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top