문제

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