• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Confused with many to many,

 
Diego Gusava
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 377
Android Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Diego Gusava
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Sean Clark like this?
 
Sean Clark
Rancher
Posts: 377
Android Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,

Yeah that looks ok to me... so what problem are you having?

Sean
 
Diego Gusava
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Sean Clark! i was confused only. Its correct now.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic