User and Admin relationship in spring boot

Viewed 14

Roles tables only two roles Admin and User only. ( Static table)

  1. Admin
  2. User

User tables - whenever user register the page, it will automatically comes (2- User (Roles table) Ex. Si.no . Name address email rollid 1 xxx yyyy zzzz 2-(Roles table ) Users only registered so Users no 2 come from Roles table

Doubt? What is the relationship between them ManyTomany or Onetoone . Many users have many roles. But my case one user object have one role only.. Which one is correct? Then how can insert value 2 to user table whenever user register the page. Please advice Two tables is enough no need for third table

0 Answers
Related