dimanche 28 juin 2015

Grails Relation m:n:n

We work with an existing mysql database under grails which contains a m:n relation. No problem here. But now we are in the situation that i have to add a second n relation entry, which links to the same table and has to be associated to the first n entry.

If it were for the database, I would simply create a table which looks like:

field m_id -> links to m table
field n_id1 -> links to n table
field n_id2 -> links to n table

But how can this be represented in a grails domain class?

Possibly the answer can already be found somewhere, but the searches I did were not successful, maybe due to lack of search term creativity.

Aucun commentaire:

Enregistrer un commentaire