| Author |
Confused with many to many,
|
Diego Gusava
Greenhorn
Joined: Apr 07, 2011
Posts: 6
|
|
Hi,
i have a database with 2 tables ...
where User Manager can have one or more user above.
how i can resolve this problem, im confused ...
|
 |
Sean Clark
Rancher
Joined: Jul 15, 2009
Posts: 377
|
|
Hey,
Firstly you don't seem to have a primary key on the UserManager table, not really a problem but you may want to add in a surrogate primary key.
Secondly I'm not sure what your question is, have you made any ORM mappings? Your user model looks ok, but remember that each User will have 2 lists, 1 will be the list of managers (users) that a user has and the other will be a list of employees (users) that the user manages each of these will map to a different column in the UserManager table.
Sean
|
I love this place!
|
 |
Diego Gusava
Greenhorn
Joined: Apr 07, 2011
Posts: 6
|
|
Sean Clark like this?
|
 |
Sean Clark
Rancher
Joined: Jul 15, 2009
Posts: 377
|
|
Hey,
Yeah that looks ok to me... so what problem are you having?
Sean
|
 |
Diego Gusava
Greenhorn
Joined: Apr 07, 2011
Posts: 6
|
|
|
Thanks Sean Clark! i was confused only. Its correct now.
|
 |
 |
|
|
subject: Confused with many to many,
|
|
|