Skip to content

ParseQuery in LiveQuery not support "include" #75

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
gmalija opened this issue Dec 1, 2017 · 1 comment
Closed

ParseQuery in LiveQuery not support "include" #75

gmalija opened this issue Dec 1, 2017 · 1 comment

Comments

@gmalija
Copy link

gmalija commented Dec 1, 2017

Hello,

I have a Table like:
ObjectId | createdAt | Job | User

What I need is get data from each pointer in my SubscriptionHandling.
But I get always:

    E/ParseLiveQueryClient: Error handling message
    java.lang.IllegalStateException: ParseObject has no data for 'Title'. Call fetchIfNeeded() to get the data.
                                                                         at com.parse.ParseObject.checkGetAccess(ParseObject.java:3599)
                                                                         at com.parse.ParseObject.getString(ParseObject.java:3175)
                                                                         at es.jobin.jobinapp.chat.ChatMainActivity$5.onEvents(ChatMainActivity.java:344)
                                                                         at com.parse.Subscription.didReceive(Subscription.java:80)
                                                                         at com.parse.ParseLiveQueryClientImpl.handleObjectEvent(ParseLiveQueryClientImpl.java:325)
                                                                         at com.parse.ParseLiveQueryClientImpl.parseMessage(ParseLiveQueryClientImpl.java:258)
                                                                         at com.parse.ParseLiveQueryClientImpl.access$000(ParseLiveQueryClientImpl.java:24)
                                                                         at com.parse.ParseLiveQueryClientImpl$1.call(ParseLiveQueryClientImpl.java:203)
                                                                         at com.parse.ParseLiveQueryClientImpl$1.call(ParseLiveQueryClientImpl.java:201)
                                                                         at bolts.Task$4.run(Task.java:357)
                                                                         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
                                                                         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
                                                                         at java.lang.Thread.run(Thread.java:760)

I read ParseLiveQuery doesn't support "include" in their ParseQuery. Is that right? Or is an error and I can solve it?

CODE:

    ParseQuery<ParseObject> queryChatHandling = ParseQuery.getQuery("Chat");
    queryChatHandling.selectKeys(Arrays.asList("Job.Title"));
    queryChatHandling.include("Job");
    queryChatHandling.whereEqualTo("User", ParseUser.getCurrentUser());

    ParseLiveQueryClient parseLiveQueryChat = ParseLiveQueryClient.Factory.getClient();
    SubscriptionHandling<ParseObject> subscriptionHandling = parseLiveQueryChat.subscribe(queryChatHandling);

    subscriptionHandling.handleEvents(new SubscriptionHandling.HandleEventsCallback<ParseObject>() {
        @Override
        public void onEvents(ParseQuery<ParseObject> query, SubscriptionHandling.Event event, ParseObject chat) {
            Log.d(TAG, "JOB TITLE: " + chat.getParseObject("Job").getString("Title"));
        }
   });

Thanks.

@flovilmart
Copy link

LiveQuery doesn’t support includes yet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants