Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/google-app-engine/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google app engine 如何编写JDO查询以基于long属性对结果进行排序?_Google App Engine_Jdo_Jdoql - Fatal编程技术网

Google app engine 如何编写JDO查询以基于long属性对结果进行排序?

Google app engine 如何编写JDO查询以基于long属性对结果进行排序?,google-app-engine,jdo,jdoql,Google App Engine,Jdo,Jdoql,我想编写一个JDO查询,它获取广告类的所有对象,然后根据long类型的time属性对其进行排序。为了获取所有广告对象,我使用以下查询 List<Advertisement> annonces = null; Query query = pm.newQuery(Advertisement.class); advertisements = (List<Advertisement>) query.execute(); List annonces=null; Query=

我想编写一个JDO查询,它获取广告类的所有对象,然后根据long类型的time属性对其进行排序。为了获取所有广告对象,我使用以下查询

 List<Advertisement> annonces = null;
 Query query = pm.newQuery(Advertisement.class);
 advertisements = (List<Advertisement>) query.execute();
List annonces=null;
Query=pm.newQuery(advision.class);
广告=(列表)query.execute();

我想添加一个过滤器,它应该根据广告类的long属性对结果进行排序。提前感谢

此查询解决了我的问题:

 Query query = pm.newQuery(Annonce.class);
 query.setOrdering("timeOfAdvertisement desc");
 annonces = (List<Annonce>) query.execute();
Query Query=pm.newQuery(Annonce.class);
query.setOrdering(“广告描述时间”);
annonces=(List)query.execute();