提交 dfdec636 编写于 作者: zhouweidong's avatar zhouweidong

copyTo优化

上级 2e7a1816
...@@ -109,13 +109,13 @@ public class EntityBase implements Serializable { ...@@ -109,13 +109,13 @@ public class EntityBase implements Serializable {
* @return * @return
*/ */
public <T> T copyTo(T targetEntity, boolean bIncEmpty){ public <T> T copyTo(T targetEntity, boolean bIncEmpty){
if(targetEntity instanceof EntityBase){ if(targetEntity instanceof EntityBase){
EntityBase target= (EntityBase) targetEntity; EntityBase target= (EntityBase) targetEntity;
Hashtable<String, Field> sourceFields=DEFieldCacheMap.getFieldMap(this.getClass()); Hashtable<String, Field> sourceFields=DEFieldCacheMap.getFieldMap(this.getClass());
for(String field : sourceFields.keySet()){ for(String field : sourceFields.keySet()){
Object value=this.get(field); Object value=this.get(field);
if( !ObjectUtils.isEmpty(value) || ObjectUtils.isEmpty(value) && getFocusNull().contains(field) && bIncEmpty ){ if( !ObjectUtils.isEmpty(value) || ObjectUtils.isEmpty(value) && getFocusNull().contains(field) && bIncEmpty ){
target.set(field,value); target.set(field,value);
} }
} }
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册