我在我的项目中使用了以下模型类
@Data
@Type("user")
@Builder()
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(of = {"id", "email"}, callSuper = true)
@JsonNaming(PropertyNamingStrategy.KebabCaseStrategy.class)
public class User extends RealmObject {
@PrimaryKey
@Id(IntegerIdHandler.class)
private int id;
private String firstName;
private String lastName;
private String email;
@Ignore
private String password;
private boolean isAdmin;
private boolean isSuperAdmin;
private String createdAt;
private String lastAccessedAt;
private String contact;
private String deletedAt;
private String details;
private boolean isVerified;
private String thumbnailImageUrl;
private String iconImageUrl;
private String smallImageUrl;
private String avatarUrl;
private String facebookUrl;
private String twitterUrl;
private String instagramUrl;
private String googlePlusUrl;
private String originalImageUrl;
}
这些注释大部分来自lombok。
当我运行我的项目时,我收到以下错误
Error:(149, 20) error: realmGet$id() in org_fossasia_openevent_core_auth_model_UserRealmProxy cannot override realmGet$id() in User
return type Integer is not compatible with int
奇怪的是,这个错误来自领域生成的代码。
有什么建议吗?