grails one to many with additional column
问题 In my Grails project I need to have a 1:N relationship between two domain classes. So, I've created the following domain class: class Receipt_HealthService { Receipt receipt HealthService healthService int quantity = 1 static constraints = { } } and in Receipt I have the following: @NotNull static hasMany = [healthServices:Receipt_HealthService] So a new table is created that has got the id of both domain class and the quantity field. When I call the save() method everything works well, but