Skip to main content

Ordering

Order by

val alphabetical = ShopTable
.orderBy(ShopTable.name)
.perform(db)

val reverseAlphabetical = ShopTable
.orderBy(ShopTable.name.desc())
.perform(db)

Nulls first and last

ShopTable
.orderBy(ShopTable.established.desc().nullsLast())
.perform(db)

ShopTable
.orderBy(ShopTable.established.asc().nullsFirst())
.perform(db)

Compound order

ShopTable
.orderBy(
ShopTable.established.desc().nullsLast(),
ShopTable.name
)
.perform(db)