Quickblox Android:使用QBRequestBuilder查询customObject

时间:2017-01-25 15:05:45

标签: android quickblox

假设我有一个名为“MyCustomObject”的customObject类,它有两个字段:“field_a”和“field_b”。

等效(使用QBRequest构建器)的内容是什么:

 Select * From MyCustomObject Where (field_a = val1 AND field_b = val2) OR (field_a = val2 AND field_b = val1)

1 个答案:

答案 0 :(得分:0)

它应该是这样的:

QBRequestGetBuilder requestBuilder = new QBRequestGetBuilder();
requestBuilder.or("field_a", "val1", "val2")

QBCustomObjects.getObjects("MyCustomObject", requestBuilder, new QBEntityCallback<ArrayList<QBCustomObject>>() {
    @Override
    public void onSuccess(ArrayList<QBCustomObject> customObjects, Bundle params) {

    }

    @Override
    public void onError(QBResponseException errors) {

    }
});

更多信息在这里是可能的 https://quickblox.com/developers/SimpleSample-customObjects-android#With_filters