is there any way i can use 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()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With