标题一、报错:org.springframework.beans.TypeMismatchException: Failed to convert property value of type ‘null’ to required type ‘double’ for property ‘bonus’; nested exception is org.springframework.core.convert.ConversionFailedException: Failed to convert from type [null] to type [double] for value ‘null’; nested exception is java.lang.IllegalArgumentException: A null value cannot be assigned to a primitive type
意思是:mgr中有null,int类型无法封装,要定义为Integer
bonus中有null,double类型无法封装,要定义为Double
解决方案:
把所有数据类型改为封装类的引用类型即可。再重新生成构造方法和toString()方法