domain « Relationship « JPA Q&A

1. Containment relationship in domain class (Grails)

I'm not sure whether it is the right terminology for this kind of relationship, so please correct me. I need to define a domain class, which maps to a ...

2. When should hasMany be used for N:1 relationships in grails domain classes?

In grails, I can implement an N:1 relationship like this:

class Parent { hasMany = [children:Child] }
class Child  { belongsTo = [parent:Parent] }
Now (if addTo and removeFrom is always properly used) ...

3. Many-to-many holding information about a relationship

In an ORM (no preference), how to best represent a many-to-many relationship between two models, when we need to hold information about this relationship?

I have an Order, which can have many ...