cascading behavior lost when using specific classes in GORM

23 views Asked by At

The basic associated flights are saved correctly in cascading way when using eg. Set for the association, but not when having a derived class for it:

class Airport {
    String name

version #1: Set flights

version #2: DerivedSet flights

    static hasMany = [flights: Flight]
}

class Flight {
    String number
    static belongsTo = [airport: Airport]
}

new Airport(name: "Gatwick")
        .addToFlights(new Flight(number: "BA3430"))
        .addToFlights(new Flight(number: "EZ0938"))
        .save(flush: true)

version #1 cascading save is working fine. version #2 cascading is not working (DerivedSet is class DerivedSet extends Set {...})

Probably during domain class transformation derived classes are not considered but not sure how to improve the framework to this direction. Thanks in case anyone can help...

0

There are 0 answers