读书人

Spring 中的BeanUtils与apache中的Bea

发布时间: 2012-11-16 14:12:14 作者: rapoo

Spring 中的BeanUtils与apache中的BeanUtils区别

org.apache.commons.beanutils.BeanUtils#copyProperties方法会进行类型转换,默认情况下会将Ineger、Boolean、Long等基本类型包装类为null时的值复制后转换成0或者false,有时这个可能会引起不必要的麻烦。

而org.springframework.beans.BeanUtils.copyProperties(bookDto, book);则不会!

读书人网 >Apache

热点推荐