我有一個使用集成開發環境 IntelliJ IDEA 的 Lombok 的 SpringBoot 項目,其中包含以下對象:@Data@Builder@NoArgsConstructor@AllArgsConstructor@JsonInclude(NON_NULL)@Entity@Table(name = "t_user_role")public class UserRole implements Serializable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @JsonIgnore private Long id; @ManyToOne(fetch = FetchType.EAGER) @JoinColumn(name = "user_id") @JsonIgnore private User user; @ManyToOne(fetch = FetchType.EAGER) @JoinColumn(name = "role_id") private Role role;}還有這個對象:@Data@Builder@NoArgsConstructor@AllArgsConstructor@JsonInclude(NON_NULL)@Entity@Table(name="t_user")public class User implements Serializable, UserDetails {.. @Override @JsonIgnore public Collection<? extends GrantedAuthority> getAuthorities() { Set<GrantedAuthority> authorities = new HashSet<>(); userRoles.forEach(ur -> authorities.add(new Authority(ur.getRole().getName()))); return authorities; }..}但我有一個編譯錯誤:但是當我使用 Maven 編譯項目時一切都很好
添加回答
舉報
0/150
提交
取消