Domain many-to-many

 
 
class TakeAwardAct {
    String title;

    static hasMany=[awards:Award]

    static constraints = {
    }

    String toString()
    {
        "${title}"
    }
}
 
 

 

 
class Award {
    String name;

    static belongsTo=[act:TakeAwardAct]
    static hasMany=[records:TakeAwardRecord]
    static constraints = {
    }

}

 

class User {
    String name;
    
    static hasMany=[records:TakeAwardRecord]

    static constraints = {
    }
}

 

class TakeAwardRecord {

    static belongsTo=[award:Award, user:User]

    static constraints = {
    }
}
相關文章
相關標籤/搜索