How can I use IN operator on Android

java

#1

I want to know how to use IN clause on Android.
Please give me an example code like below.

String modifyCode = “[1001,1002]”;

Database database = DatabaseManager.getDatabase();
Query qry = QueryBuilder
.select(SelectResult.expression(Meta.id),
SelectResult.property(“MODIFY_OPTION_NAME”),
SelectResult.property(“MODIFY_OPTION_PRICE”))
.from(DataSource.database(database))
.where(Expression.property(“type”).equalTo(Expression.string(“OPTION”))
.and(Expression.property(“MODIFY_CODE”).in(Expression.string(modifyCode)))
);


#2

I found the answer.

Expression values = new Expression {
Expression.property(“first”),
Expression.property(“last”),
Expression.property(“username”)
};

Query query = QueryBuilder.select(SelectResult.all())
.from(DataSource.database(database))
.where(Expression.string(“Armani”).in(values));