使用了 JPA 、Lombok 代码如下:
@Data
@Entity
public class User {
private List<Role> roles;
}
@Data
@Entity
public class Role {
@JsonIgnore
@ManyToMany(mappedBy = "roles")
List<User> users;
}
同样的代码在 Spring Boot 2.7.16 中没问题,在 Spring Boot 3.1.4 中就不行了,是哪里没写对吗?