错误信息
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:
Error querying database. Cause: java.lang.IndexOutOfBoundsException: Index: 5, Size: 5
Cause: java.lang.IndexOutOfBoundsException: Index: 5, Size: 5
java.lang.IndexOutOfBoundsException: Index: 5, Size: 5
org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:75
网上搜了一下其他人的都是新增或者调selectList的时候报的这个错,但是我的是自己写的sql自己配置的返回映射的查询报的错,查几个字段Index: 5, Size: 5就是几
解决方案
我在实体里面添加了一个空的构造解决的
public LabCorp() {
// Do nothing because of X and Y.
}