User and Admin relationship in spring boot

Issue

This Content is from Stack Overflow. Question asked by antopepin a

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



Solution

This question is not yet answered, be the first one who answer using the comment. Later the confirmed answer will be published as the solution.

This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?