java.lang.IllegalStateException: Optional int parameter 'type' is present but cannot be translated into a null value due to being declared as a primitive type. Consider declaring it as object wrapper for the corresponding primitive type.
这个错误的大体意思是:存在可选int形参'type',但由于被声明为基本类型,因此不能转换为空值。考虑将其声明为对应基本类型的对象包装器
我的情景是在我进行分页查询时,为了接收前端传来的类型值(0,1),但是由于类型这个参数不是必须参数,所以呢传来的是null值,但是由于基本类型不能为null,所以要将基本数据类型包装成引用数据类型来赋予null。
修改成integer便不会报错,若是以后有int的类型参数,最好用integer去接收
解决错误后,分页成功,不在报错