我想为我的表设置自增主键。
这是我的类。我已经设置了主键,但我希望它成为自增主键。
public class users extends RealmObject {
@PrimaryKey
private int id;
private long icn;
private String name;
private String email;
private String password;
private int phone;
public String getName() {
return name;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public long getIcn() {
return icn;
}
public void setIcn(long icn) {
this.icn = icn;
}
public void setName(String name) {
this.name = name;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public int getPhone() {
return phone;
}
public void setPhone(int phone) {
this.phone = phone;
}
}
谢谢您提前。