ITeye博客

Spring 中的BeanUtils与apache中的BeanUtils区别

一杯白开水w · 2011-08-12 18:38 · Spring · 编程语言 · Markdown

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

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

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。