• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ManyToMany & fields of association table

 
Musab Al-Rawi
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am posting my question here since I didn't get much of response in the other forum, and it is more relevant here, sorry for repeating the question:

Here is an example to explain my questions:
let's say there is entity FOLDER that has a many to many relationship with GROUP. I could do the design as follows:

Where and How can I represent INFO?
Is the following a better design (of courseDUMMY entity won't be named DUMMY!)?
Personally I want to go for the first design but I don't know how to represent INFO field.
In that case I define Folder and Group entities as follows:
In Folder
folder

In Group


Again how to access INFO column located in folder_group table?
Some suggested that I could use two OneToMany relationships which is possible but I am trying to figure if there is a direct solution for the situation.

Your help is greatly appreciated.
 
Edvins Reisons
Ranch Hand
Posts: 364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A typical approach is to decompose the many-to-many relationship into two many-to-one. Then your Folder Group becomes an entity and can contain any number of additional mapped properties.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic