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 = {
    }
}

 

 

posted @ 2014-01-17 15:28  Lost in code  阅读(140)  评论(0编辑  收藏  举报