问题来源:
在数据库中查询一个列表的长度时,需要转换为Integer类型,我刚开始直接转就报错了。因为在数据库中用count(*) 聚合函数返回的值类型为BigDecimal,不能直接转换为Integet类型,
解决办法:
先转换为String类型,再转为Integer类型。