开发者

How to use ORDERBY with findAll() in Play

is there any way i can us开发者_如何学Pythone ORDERBY with findAll() in Play Framework?


Model.findAll() is a shortcut which fetches the results right away, it's equivalent to Model.all().fetch().

I think the best way to specify order is by using a JPQL query like this:

Model.find("order by fieldName desc").fetch();


This line seemed to work for me (play 2.1)

find.where().orderBy("fieldname desc").findList()
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜