Robin
Robin

Reputation: 563

In eabean how to sort multiple column

In eabean how to sort by multiple column.

Ex: .orderBy().asc(field1).orderBy().asc(field2)

I am trying this but it only considering field2 for sorting.

Upvotes: 0

Views: 165

Answers (1)

pedroct92
pedroct92

Reputation: 411

Ebean.find(YourBean.class)
 .where()
  .eq("name", "test")
 .orderBy().desc("name, id")
.findList();

That's all you need to do separate the properties with commas.

Upvotes: 1

Related Questions