<500内部服务器错误,“消息”:“无法执行语句; SQL [n / a];嵌套的异常是org.hibernate.exception.DataException

时间:2019-01-29 11:31:41

标签: java json

这是我的POJO的样子:

@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"testData"
)}

public class Data {
@JsonProperty("testData")
    private List<TestData> testData = null;

        @JsonProperty("data")
    public List<Data> getTestData() {
        return testData;
    }

    @JsonProperty("testData")
    public void setTestData(List<TestData> testData) {
        this.testData = testData;
    }
}

子类:

@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"vat"
})
public class TestData {

    @JsonProperty("vat")
    private String vat;

        @JsonProperty("vat")
    public String getVat() {
        return vat;
    }

    @JsonProperty("vat")
    public void set(String vat) {
        this.vat = vat;
    }
}

我需要以此格式发送增值税的值作为“§12”,以及发送方式:

Data data = new data();
List<TestData> testDataList = new ArrayList<TestData>();
TestData testData = new TestData();
testData.setVat(§12);
testDataList.add(testData);
data.setTestData(testDataList);

在执行上述代码时,出现以下错误:

"message":"could not execute statement; SQL [n/a]; nested exception is org.hibernate.exception.DataException: could not execute statement"}],{Server=[nginx/1.15.7], Date=[Tue, 29 Jan 2019 10:51:10 GMT], Content-Type=[application/json;charset=UTF-8], Transfer-Encoding=[chunked], Connection=[keep-alive], X-Content-Type-Options=[nosniff], X-XSS-Protection=[1; mode=block], Cache-Control=[no-cache, no-store, max-age=0, must-revalidate], Pragma=[no-cache], Expires=[0], X-Frame-Options=[DENY], X-Application-Context=[bps-external-ws:qa,g-qa4,kubernetes:8080]}>

有人可以帮忙吗?

0 个答案:

没有答案