Support and Documentation

Binding collection variables

You can also bind a variable that is a collection, such as a Set or List, to a query. At run time, Dari performs the operation in the .where method against all elements in the collection. In the following snippet, the query searches for all instances of User with a name value that matches any name in the list names.

 List<String> names = new ArrayList<String>();
 names.add("John Smith");
 names.add("Jane Doe");
 List<User> users = Query.from(User.class)
                         .where("name = ?", names).selectAll();