Я пытаюсь вставить JSON в базу данных 'ORMLITE', но выдает ошибку.
Мой JSON:
{
"employee_details": [
{
"bARNID": "1",
"bIRTHDATE": "10.10.2015",
"dELIVERYDATE": "10.10.2015",
"govNR": "AT000000000001",
"nAME": "Name1",
"sMARTBOW": "A11A"
},
{
"bARNID": "2",
"bIRTHDATE": "11.10.2015",
"dELIVERYDATE": "11.10.2015",
"govNR": "DE000000000002",
"nAME": "Name2",
"sMARTBOW": "B22B"
}
]
}
Классы моделей, которые я создал:
@DatabaseTable(tableName = "employee_details")
public class Master implements Serializable {
@DatabaseField(columnName = "employee_details")
@Expose
private List<Emplyeedetail> emplyeedetails = new ArrayList<Emplyeedetail>();
public List<Emplyeedetail> getEmplyeedetails() {
return emplyeedetails;
}
public void setEmplyeedetails(List<Emplyeedetail> emplyeedetails) {
this.emplyeedetails = emplyeedetails;
}
}
другой класс модели:
@DatabaseTable(tableName = "emplyeedetail")
public class Emplyeedetail {
public Emplyeedetail(String govNR, String sMARTBOW,String bIRTHDATE,String nAME,String bARNID ,String dELIVERYDATE ) {
this.govNR = govNR;
this.sMARTBOW = sMARTBOW;
this.bIRTHDATE = bIRTHDATE;
this.nAME = nAME;
this.bARNID = bARNID;
this.dELIVERYDATE = dELIVERYDATE;
}
public Emplyeedetail() {
}
@DatabaseField(columnName = "GovNR")
private String govNR;
@DatabaseField(columnName = "SMARTBOW")
private String sMARTBOW;
@DatabaseField(columnName = "BIRTHDATE")
private String bIRTHDATE;
@DatabaseField(columnName = "NAME")
private String nAME;
@DatabaseField(columnName = "BARNID")
private String bARNID;
@DatabaseField(columnName = "DELIVERYDATE")
private String dELIVERYDATE;
public String getBARNID() {
return bARNID;
}
public void setBARNID(String bARNID) {
this.bARNID = bARNID;
}
public String getBIRTHDATE() {
return bIRTHDATE;
}
public void setBIRTHDATE(String bIRTHDATE) {
this.bIRTHDATE = bIRTHDATE;
}
public String getDELIVERYDATE() {
return dELIVERYDATE;
}
public void setDELIVERYDATE(String dELIVERYDATE) {
this.dELIVERYDATE = dELIVERYDATE;
}
public String getGovNR() {
return govNR;
}
public void setGovNR(String govNR) {
this.govNR = govNR;
}
public String getNAME() {
return nAME;
}
public void setNAME(String nAME) {
this.nAME = nAME;
}
public String getSMARTBOW() {
return sMARTBOW;
}
public void setSMARTBOW(String sMARTBOW) {
this.sMARTBOW = sMARTBOW;
}
@Override
public String toString() {
return "Emplyeedetail{" +
"bARNID='" + bARNID + '\'' +
", bIRTHDATE='" + bIRTHDATE + '\'' +
", dELIVERYDATE='" + dELIVERYDATE + '\'' +
", govNR='" + govNR + '\'' +
", nAME='" + nAME + '\'' +
", sMARTBOW='" + sMARTBOW + '\'' +
'}';
}
}
ошибка, которую я получаю:
java.lang.IllegalArgumentException: ORMLite не знает, как хранить
Интерфейс java.util.List для поля emplyeedetails. Используйте другой класс
или пользовательский персистер.