谷歌应用引擎中的排序结果
我正在尝试使用 objectify 和 GAE 进行简单的排序。不幸的是它不起作用。这是一个简单的例子
class Book{
int publishYear;
long price;
}
根据谷歌,你必须对你进行不等式过滤的字段进行排序。所以我做了以下操作
query.filter("publishYear >=", year)
query.order("publishYear")
,然后我想按价格订购,所以我添加了该行,
query.order("price")
但什么也没有发生。我尝试了不同的字段,似乎每个查询只能下一个订单。尽管此示例的内容有所不同
http://code.google.com /appengine/docs/java/datastore/queries.html#Restrictions_on_Queries
有人有线索吗?提前致谢
Iam trying to make a simple ordering using objectify and GAE. Unfortunatly it does't work. here is a simple example
class Book{
int publishYear;
long price;
}
According to google, you have to order the field that you made your inequality filtering on it. so i did the following
query.filter("publishYear >=", year)
query.order("publishYear")
then i want to order with price so i added the line
query.order("price")
but nothing is happening. I tried on different fields, it seems you can make only one order per query. Although this example says something different
http://code.google.com/appengine/docs/java/datastore/queries.html#Restrictions_on_Queries
Anybody has a clue? thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Objectify 文档说:
希望它会有所帮助。
The Objectify documentation says:
Hope it will helps.