有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java领域生成的代码错误:返回类型Integer与int不兼容

我在我的项目中将realm与以下模型类一起使用

@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;
}

这些注释大部分来自龙目岛

当我运行我的项目时,我得到以下错误

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

奇怪的是,这个错误是由领域生成的代码引起的

有什么建议吗


共 (0) 个答案