ParseQuery<Custom> query = ParseQuery.getQuery(Custom.class);
query.whereEqualTo("user", ParseUser.getCurrentUser());
query.include("address");
query.fromLocalDatastore();
query.getFirstInBackground(new GetCallback<Custom>() {
@Override
public void done(Custom c, ParseException e) {
c.getAddress().getName(); //this gives me fetchIfneeded exception.
}
});
如果我这样做
ParseQuery<Address> query = ParseQuery.getQuery(Address.class);
query.fromLocalDatastore();
query.findInBackground(new FindCallback<Address>() {
@Override
public void done(List<Address> addresses, ParseException e) {
for(Address address: addresses) {
address.getName(); //it works just fine
}
}
});
看起来包含不适用于本地数据存储区。 这是设计的吗?还是错过了什么?
编辑: 我可以通过添加
来生存c.getAddress().fetchFromLocalDatastore();