Spring boot JPA many to many with extra column insert and update issue
问题 Here is my initial question. Spring Data JPA Many to Many with extra column User and Roles Now I have the right tables created, but can't make it work for the update. Here is the code: User.java @Entity @Table(name = "users") public class User { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private String username; @OneToMany(mappedBy="user", cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.LAZY) private List<UserRole> roles; // getters and setters