concept one - to - many relationship in category grails

appears as: one-to-my relationship, one-to-many relationship, one-to-my relationships
Grails in Action, Second Edition

This is an excerpt from Manning's book Grails in Action, Second Edition.

With hasMany and belongsTo in place, you have all the basics of the one-to-many relationship. But how do we tell Grails to add new Posts for a given User? With more GORM magic.

Once you have a one-to-many relationship between User and Post, Grails automatically adds two new methods to your User class: User.addToPosts() and User.remove-FromPosts(). You need to create an integration test for Post so you can exercise these new capabilities. Start with the usual process: