Answers for "relational in grails"

0

relational in grails

//One-to-many
 class Author {
    static hasMany = [books: Book]
    String name
}

///Other domain
class Book {
    String title
}
Posted by: Guest on February-11-2021
0

relational in grails

//Many-to-many
class Book {
    static belongsTo = Author
    static hasMany = [authors:Author]
    String title
}

//Other domain
class Author {
    static hasMany = [books:Book]
    String name
}
Posted by: Guest on February-11-2021

Code answers related to "relational in grails"

Browse Popular Code Answers by Language