Mutual copy between beans

  Mutual copy between beans

  Assign the bean directly to bo

  import org.springframework.beans.BeanUtils;

  public CusFirmBeanVo findByCustomerKey(long customerKey) {

CusFirmBean entity = cusFirmDao.findByCustomerKey(customerKey);

if (entity == null)

return null;

CusFirmBeanVo target = new CusFirmBeanVo();

BeanUtils.copyProperties(entity, target);

return target;

}

 

TbCusUserBean bo = new TbCusUserBean ();

BeanUtils.copyProperties(tbCusUserBeanVo, bo, "rolesName","rolesKey" );//Ignore property copy

Map<String, Object> paramUp = new HashMap<String, Object>();

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326512976&siteId=291194637