Could not copy properties from source to target
-
可能原因 源目标为null
参考文献:https://blog.youkuaiyun.com/rchm8519/article/details/7101911?biz_id=102 -
源目标与目标bean 属性类型不一致
解决方案:
直接修改属性类型 会导致代码以依赖过多,容易出错; 可以使参考一下方法:
String[] ignoreProperties 参数含义: 复制bean时对数组内的属性进行过滤;
过滤后 , 只需要复制完bean之后对该属性进行手动 set 值即可