AVQuery<AVObject> avQuery = new AVQuery<>("Job");
    avQuery.include("company");
    avQuery.getInBackground(id).subscribe(new MyObserver<AVObject>() {
        @Override
        public void onNext(AVObject avObject) {
           //...
        }
    });

company依旧只有id,没有其他数据

您好,麻烦提供一下 SDK 版本号,和相关 Dubug 日志。

日志格式类似:

2020-01-09 17:32:45.628 27180-27211/com.example.myapplicationtest D/LoggingInterceptor: Request: curl -X GET 
     -H Accept: application/json 
     -H Content-Type: application/json 
     -H User-Agent: LeanCloud-Java-SDK/6.1.9 
     -H X-LC-Id: JMBPc7y4SUPRDrOSHXjXVMN7-gzGzoHsz 
     -H X-LC-Prod: 1 
     -H X-LC-Session: {your_session} 
     -H X-LC-Sign: {your_sign} 
    https://jmbpc7y4.lc-cn-n1-shared.com/1.1/classes/TestObject/5e05d36421b47e007079c26d
2020-01-09 17:32:45.629 27180-27211/com.example.myapplicationtest D/LoggingInterceptor: Response: 200 
    server: openresty
    date: Thu, 09 Jan 2020 09:32:45 GMT
    content-type: application/json;charset=utf-8
    vary: Accept-Encoding
    cache-control: no-cache,no-store
    pragma: no-cache
    last-modified: Fri, 27 Dec 2019 09:48:20.682 GMT
    strict-transport-security: max-age=31536000
     
    {"num":12,"updatedAt":"2019-12-27T09:48:20.682Z","parent":{"__type":"Pointer","className":"TestSubObject","objectId...

SDK 6.1.6

D/LoggingInterceptor: Request: curl -X GET
-H Accept: application/json
-H Content-Type: application/json
-H User-Agent: LeanCloud-Java-SDK/6.1.6
-H X-LC-Id: 3QYvbatqmTKo5aIK9KJvdolx-gzGzoHsz
-H X-LC-Prod: 1
-H X-LC-Session: {your_session}
-H X-LC-Sign: {your_sign}
https://zp.91liangcai.com/1.1/classes/Job/5e11e493dd3c13006a7c9a23
D/LoggingInterceptor: Response: 200
server: openresty
date: Thu, 09 Jan 2020 11:02:47 GMT
content-type: application/json;charset=utf-8
vary: Accept-Encoding
cache-control: no-cache,no-store
pragma: no-cache
last-modified: Tue, 07 Jan 2020 18:04:33.203 GMT
strict-transport-security: max-age=31536000

{"updatedAt":"2020-01-07T18:04:33.203Z","content":"\u57fa\u7840\u7684\u6587\u5458\u5de5\u4f5c\n\n\u8981\u6c42\u672a\u5a5a","name":"\u62db\u8058\u6587\u5458","objectId":"5e11e493dd3c13006a7c9a23","createdAt":"2020-01-05T13:28:51.146Z","company":{"__type":"Pointer","className":"Company","objectId":"5e0efac6dd3c13006a6206a9"}}

你好,getInBackground(id) 这个确实有问题,您先用 query.findInBackground()...替换,这个 Bug 我们后续版本会改。

AVQuery<AVObject> query = new AVQuery<>("Job");
query.include("company");
query.whereEqualTo("objectId", "123");
query.findInBackground().subscribe(new Observer<List<AVObject>>() {
    public void onSubscribe(Disposable disposable) {}
    public void onNext(List<AVObject> comments) {}
    public void onError(Throwable throwable) {}
    public void onComplete() {}
});

好的,谢谢,希望能尽快修正,就不用大面积替换代码了..

对了,顺带一提 getFirstInBackground()这个方法也有同样的问题

getFirstInBackground() 应该是好的,getInBackground 这个方法里面忽略了 include keys,我们今天会发一个版本修复它。