grails « Relationship « JPA Q&A





1. Grails - how to enforce at least one in a one to many relationship    stackoverflow.com

Please can you help with the example below:

class Car {

    static hasMany = [cd:Cd, fluffyDice:FluffyDice, wheel:Wheel]

}



class Wheel{

     static belongsTo = [car:Car]

}
How do I enforce ...