---
title: "Spring 中的BeanUtils与apache中的BeanUtils区别"
author: "一杯白开水w"
date: "2011-08-12T18:38:11Z"
tags: []
categories: ["编程语言"]
slug: "spring-beanutils-apache-beanutils"
draft: false
lastmod: "2011-08-12T18:38:11Z"
id: 1147728
url: "https://wlt2008-com.iteye.com/blog/1147728"
---

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

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