Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/80.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql 不匹配多个对象的查询_Sql_Playframework_Playframework 2.0_Ebean - Fatal编程技术网

Sql 不匹配多个对象的查询

Sql 不匹配多个对象的查询,sql,playframework,playframework-2.0,ebean,Sql,Playframework,Playframework 2.0,Ebean,我想有一个查询,给我一个对象列表,这些对象不包含规则,例如id=10 为此,我可以这样写: new Finder<>(Long.class, Device.class).where().ne("id", 10l).findList(); 现在我想说的是,列出一个id所在的位置=10&&id=20 && ... 要实现这一点,一种方法是使用multiple.ne,但我不知道我的列表可以有多长 有没有办法做到这一点 我使用Play framework 2.3.4附带的Ebean 谢谢您

我想有一个查询,给我一个对象列表,这些对象不包含规则,例如id=10 为此,我可以这样写:

new Finder<>(Long.class, Device.class).where().ne("id", 10l).findList();
现在我想说的是,列出一个id所在的位置=10&&id=20 && ... 要实现这一点,一种方法是使用multiple.ne,但我不知道我的列表可以有多长

有没有办法做到这一点

我使用Play framework 2.3.4附带的Ebean


谢谢

您可以使用以下方法:

/**
* Not In - property has a value in the array of values.
*/
ExpressionList<T> notIn(String propertyName, Object... values);

/**
* Not In - property has a value in the collection of values.
*/
ExpressionList<T> notIn(String propertyName, Collection<?> values);

Ebean.find(Device.class).where().notIn("id", myArrayOfIds).findList();

Ebean.find(Device.class).where().notIn("id", myListOfIds).findList();