dates in app engine java

38 views
Skip to first unread message

Joan Torres

unread,
Oct 10, 2019, 10:22:42 AM10/10/19
to Google App Engine

When I try to order a query in app engine java, by date, I find that it does not order the query correctly.

This is the case I have:

three records the first one has the date like this 10/09/2019 (09:21:00) 

the second like this 10/09/2019 (12:20:12) and 

the third one is like this 10/09/2019 (13:28:00)


but the order given by app engine is the opposite

first 10/09/2019 (12:20:12) 

second 10/09/2019 (09:21:00) 

third 10/09/2019 (13:28:00)


When the correct way to do the query is:


First 10/09/2019 (09:21:00) 

second 10/09/2019 (12:20:12) 

third 10/09/2019 (13:28:00)

I have tried in several ways but I can't find a solution, I appreciate your help to improve this process.

George (Cloud Platform Support)

unread,
Oct 10, 2019, 11:50:03 AM10/10/19
to Google App Engine
Hello Joan, 

How did you perform the query? Do you refer to com.google.appengine.api.datastore Class Query? There is a Enum Query.SortDirection. Did you use Cloud SQL? 

This discussion group is oriented more towards general opinions, trends, and issues of general nature touching App Engine and Cloud SQL. For query order by issues you may be better served in dedicated forums such as stackoverflow, where experienced programmers are within reach and ready to help. 
Message has been deleted
Message has been deleted

Joan Torres

unread,
Oct 11, 2019, 10:32:31 AM10/11/19
to Google App Engine
Hi Jorge, thank you very much for the guidance, I have already created the post on stackoverflow.


This is the filter that I am applying and the ordering of the date in the offspring

List operationList = ofy().load().type(Operation.class).filter(compositeFilter).order("-date").order("-codeOperation").list();


El jueves, 10 de octubre de 2019, 10:50:03 (UTC-5), George (Cloud Platform Support) escribió:
Hola joan 

¿Cómo realizó la consulta? ¿Te refieres a com.google.appengine.api? consulta de clase del almacén de datos ? Hay una Enum Query.SortDirection. ¿Usaste Cloud SQL? 

Este grupo de discusión está más orientado hacia opiniones generales, tendencias y cuestiones de naturaleza general que afectan a App Engine y Cloud SQL. Para el orden de las consultas por problemas, es posible que reciba un mejor servicio en foros dedicados como stackoverflow, donde los programadores experimentados están al alcance y listos para ayudar. 
Reply all
Reply to author
Forward
0 new messages