使用BeanUtils.copyProperties()方法copy两个对象;错误发现了:
原来使用的是org.apache.commons.beanutils.BeanUtils的copyProperties()方法
import org.apache.commons.beanutils.BeanUtils;
copyProperties(Object dest, Object orig)
第一个参数是目标对象,第二个参数是源对象;我把两个对象写反了:
BeanUtils.copyProperties(bkHotKeyword,wsHotKeywordDto);
使用org.springframework.beans.BeanUtils的copyProperties()方法
import org.springframework.beans.BeanUtils;
copyProperties(Object sourth, Object target)
左边是源对象,右边是目标对象;
转载于:https://blog.51cto.com/4610383/1282267