0

Hello sir I am trying to get data from datastore of google app engine. I am executing following query to get data in descending order using app engine endpoint method.

Query highScorer = mgr.createQuery("select from CheckIn as CheckIn ORDER BY CheckIn.score DESC LIMIT 1");

Actually above query should give only one result but I am getting all entity in descending order. How to query for only one result.? Is there any thing wrong I am doing in Query? Thanks

Please let me know if i have to provide more information.

user3687223
  • 185
  • 5
  • 14

1 Answers1

1

I got the solution. The above query should be written like below to get only one result.

Query highScorer = mgr.createQuery("select from CheckIn as CheckIn ORDER BY CheckIn.score DESC").setMaxResults(1);

Hope this will help someone. Thanks

user3687223
  • 185
  • 5
  • 14