Grails: multiple relationships between two domain objects

前端 未结 3 862
孤城傲影
孤城傲影 2021-02-09 15:24

I am trying to implement two different types of relationships between two domain classes in Grails.

Consider the following; I have two domain classes, an Author and Book

3条回答
  •  爱一瞬间的悲伤
    2021-02-09 16:02

    Modify Book domain class. Remove author mapping.

    class Book{
       String title
       static belongsTo = [Author]
    }
    

    Look for the new table FAVORITE_BOOKS once clean and run-app.

提交回复
热议问题