首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 服务器 > Apache >

Spring 中的BeanUtils与apache中的BeanUtils差别

2012-11-16 
Spring 中的BeanUtils与apache中的BeanUtils区别org.apache.commons.beanutils.BeanUtils#copyProperties

Spring 中的BeanUtils与apache中的BeanUtils区别

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

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

热点排行