Let\'s say I have definied a User object using GORM. Each user can have zero or more Login:s. Each Login has a timestamp. When retrieving user.logins I want the logins to be sor
They show how to do this on the GORM page in the reference guide (section 5). The bit you want is near the bottom of that document is the section you want. They have two simple examples:
class Airport {
…
static mapping = {
sort "name"
}
}
class Airport {
…
static mapping = {
sort name:"desc"
}
}
They also have an example of sorting on an association:
class Airport {
…
static hasMany = [flights:Flight]
static mapping = {
flights sort:'number'
}
}