我知道如何创建关系:
QBCustomObject customObject = new QBCustomObject("Comment"); // your Class name
customObject.put(fieldHealth, 99);
customObject.put("text", "The first film in the series was...");
customObject.setParentId("50aa4d8fefa357fa14000001");
QBCustomObjects.createObject(qbCustomObject, new QBCallbackImpl() {
@Override
public void onComplete(Result result) {
if (result.isSuccess()) {
QBCustomObjectResult qbCustomObjectResult = (QBCustomObjectResult) result;
QBCustomObject qbCustomObject = qbCustomObjectResult.getCustomObject();
Log.d("New record: ",newCustomObject.toString());
} else {
Log.e("Errors",result.getErrors().toString());
}
}
});
但是,当我有父ID时如何检索?
答案 0 :(得分:2)
您应该单独请求:
QBCustomObjectRequestBuilder requestBuilder = new QBCustomObjectRequestBuilder();
requestBuilder.eq("_parent_id", "50aa4d8fefa357fa14000001");
QBCustomObjects.getObjects(CLASS_NAME, requestBuilder, new QBCallbackImpl(){...