我正在使用SugarOrm(依赖项:'com.github.satyan:sugar:1.5')。我试图在表中显示存储的值,但不幸的是我遇到了此异常。
java.lang.IllegalAccessException: Class java.lang.Class<com.orm.SugarRecord> cannot access method void com.tranquil.bioattendance.models.PRIME_APPUSER.<init>() of class java.lang.Class<com.tranquil.bioattendance.models.PRIME_APPUSER>
代码:
//Here the record is getting stored successfully
PRIME_APPUSER loginUserModel = new PRIME_APPUSER ();
//setter methods
loginUserModel.save();
List<PRIME_APPUSER> loginUserList = PRIME_APPUSER.listAll(PRIME_APPUSER.class);
// the last line is where exception is occurring
这是我的课程:
public class PRIME_APPUSER extends SugarRecord {
PRIME_APPUSER() {
}
@SerializedName("FormId")
@Expose
private Integer FormId;
@SerializedName("Role")
@Expose
private String Role;
@SerializedName("FormDate")
@Expose
private String FormDate;
@SerializedName("UserName")
@Expose
private String UserName;
@SerializedName("PassWord")
@Expose
private String PassWord;
@SerializedName("SecurityQue")
@Expose
private String SecurityQue;
@SerializedName("Answer")
@Expose
private String Answer;
public Integer getFormId() {
return FormId;
}
public void setFormId(Integer formId) {
FormId = formId;
}
public String getRole() {
return Role;
}
public void setRole(String role) {
Role = role;
}
public String getFormDate() {
return FormDate;
}
public void setFormDate(String formDate) {
FormDate = formDate;
}
public String getUserName() {
return UserName;
}
public void setUserName(String userName) {
UserName = userName;
}
public String getPassWord() {
return PassWord;
}
public void setPassWord(String passWord) {
PassWord = passWord;
}
public String getSecurityQue() {
return SecurityQue;
}
public void setSecurityQue(String securityQue) {
SecurityQue = securityQue;
}
public String getAnswer() {
return Answer;
}
public void setAnswer(String answer) {
Answer = answer;
}
}
我也在应用程序类中启动SugarContext。我的其他表没有任何问题,仅此表给出了错误。 任何建议,