Reputation: 672
is there any way i can use ORDERBY with findAll() in Play Framework?
Upvotes: 8
Views: 8043
Reputation: 1920
This line seemed to work for me (play 2.1)
find.where().orderBy("fieldname desc").findList()
Upvotes: 10
Reputation: 4433
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();
Upvotes: 17