I need to create a many-to-many relationship in Grails.
I have a "Question" domain and a "Tag" domain. A Question can have 0 or more tags. A Tag can have 0 or more Questions.
If I put a "hasMany" on each sides, it gives me an error saying I need a "belongTo" somewhere. However, adding a belongsTo means that the owner must exist...
Like I said, a Tag could have 0 questions, and a Question could have 0 tags. There is no concept of an owner, it's a many-to-many!
What am I supposed to do?
A collection of articles and resources of interest to the modern software developer
Your work is going to fill a large part of your life, and the only way to be truly satisfied is to do what you believe is great work. And the only way to do great work is to love what you do.
-- Steve Jobs
Thursday, June 23, 2011
How to handle Many-To-Many In Grails without belongsTo? - Stack Overflow
How to handle Many-To-Many In Grails without belongsTo? - Stack Overflow
Labels:
Grails
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment