Answer the question
In order to leave comments, you need to log in
What does @ManyToMany mean?
Please explain what this code means:
@ManyToMany(mappedBy = "roles")
private Set<User> users;
Answer the question
In order to leave comments, you need to log in
Many-to-many relationship.
Specifically in your example: each user can have multiple roles, and multiple people can be assigned to each role.
Example
Vasya has 2 roles in your system: editor, administrator
At the same time, there may be other administrators in the system.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question