java.lang.IndexOutOfBoundException错误、通用Mapper插件 String index out of range: 0错误

资料:

(1)Mybatis 查询结果类型Character异常

https://blog.csdn.net/andywja/article/details/80353249

数组越界,只有几种可能:

1:你没有得到数据,就使用了数组的某一项,比如第一项

//示例:
List<String> list = new ArrayList<String>();
list.get(1);//list为空列表,第一项为空

2:你得到的数据可能是n条,但是用到了n+1条.

通用Mapper插件 String index out of range: 0错误

private Character type;//此处为错误的地方,不能使用Character作为数据库表映射的字段类型,因为Mybatis对Character类型转换时,对Character属性只进行了null的判断没有对长度进行判断,而获取值的时候直接使用charAt(0);所以只要Character类型字段的结果是空字符串的情况,就会报异常。
原文地址:https://www.cnblogs.com/wu-1393180819/p/9552984.html