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

    }

}

 

 

你可能感兴趣的:(domain)