commons-beanutils.jar包中BeanUtils.copyProperties方法对数值型值的注意

commons-beanutils.jar包中BeanUtils.copyProperties方法对数值型值的注意 方法BeanUtils.copyProperties(target, source)中,如果source中有一个数值型的变量,比如Long型的变量a,值 为null的。通过方法拷贝到target中时a这个变量的值会变成0。所以如果用BeanUtils.copyProperties方法,又不想让变量 有值的话,那么在用完这个方法之后,对一些数值型的变量最好再set一次。

你可能感兴趣的:(null)