Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6531957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:56:29+00:00 2026-05-25T09:56:29+00:00

At the moment I am getting the top scores for my Android application from

  • 0

At the moment I am getting the top scores for my Android application from the datastore as follows:

     Query query = pm.newQuery(PlayerPersistentData.class);
     query.setOrdering("rating desc");
     query.setRange(0, 25);

However, I would also like to order the results by the count of a secondary column:

E.g. In normal SQL it would be something like this:

select PlayerPersistentData.*, count(achievements) as achievements_count
from PlayerPersistentData
order by rating desc, achievements_count desc

Achievements is defined in the datastore as follows

@Persistent
private Set<Integer> achievements;

Is this possible using the GAE datastore? And if so how should I create my query?

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T09:56:29+00:00Added an answer on May 25, 2026 at 9:56 am

    You need to denormalize: store the count as a separate field on your entity, and query on that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

at the moment im loading xml and i am getting error: System.Xml.XmlException: ' ',
Looking for books, blogs, web sites or videos. At the moment I am getting
I am having trouble getting a ListView to display anything in my application. I
I'm using mootools-1.2.3 at the moment and I'm having trouble getting a variable to
I'm just getting started with android development and I need help with background images.
At the moment I am getting a KrbException: Integrity check on decrypted field failed
My goal sounds fairly simple, at the moment i'm having an issue getting my
I am proper struggling getting that "magic" moment when WCF is configured nicely and
I'm using Fluid 960 at the moment, and I'm getting some weird behavior with
At the moment, I'm doing stuff like the following, which is getting tedious: run_once

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.