一、报错内容
Mapper method 'com.xxx.GitCommitStatisticsMapper.calShowTimeGitLabCommitLines attempted to return null from a method with a primitive return type (int)
二、报错说明
这个错误信息表明在使用MyBatis的Mapper接口GitCommitStatisticsMapper
时,方法calShowTimeGitLabCommitLines
尝试从一个应该返回基本数据类型(在此例中是int
)的方法返回null
。
由于int
是Java中的基本数据类型,它不能持有null
值,因此导致了此错误。
三、问题解决
要解决这个问题,您可以考虑以下几种方法: