0
votes
class A {
    hasMany = [b: B]
} 
class B {
    int type
    String title
    belongsTo = [a: A]
}

Is there any way to get or list type A, which would have collections of type B sorted in one case by type, in another by title?

1

1 Answers

0
votes

Try this code:

def listOfA = A.withCriteria {
    eq "id", 123456
    b {
        and {
            order "type", "desc"
            order "title", "desc"
        }
    }
}