📜  grails 中的关系 - Groovy 代码示例

📅  最后修改于: 2022-03-11 15:01:05.294000             🧑  作者: Mango

代码示例1
//One-to-many
class Book {
    static belongsTo = Author
    static hasMany = [authors:Author]
    String title
}
//Other domain
class Author {
    static hasMany = [books:Book]
    String name
}