public static void form2To(ModelObject dest, Map<String, Object> orig) {

    debug("form2To-- props:" + orig);

    try {

      HashMap<String, Object> _props = new HashMap<String, Object>();

      PropertyDescriptor srcDescriptors[] =
          BeanUtilsBean.getInstance().getPropertyUtils().getPropertyDescriptors(dest);

      for (PropertyDescriptor pd : srcDescriptors) {
        String fn = pd.getName();
        if ("class".equals(fn)) {
          continue;
        }
        Class type = pd.getPropertyType();

        debug("fn:" + fn + " type:" + type);
        if (!orig.containsKey(fn)) {
          continue;
        }

        Object value = orig.get(fn);
        if (value == null) {
          _props.put(fn, value);
          continue;
        }

        if (ModelObject.class.isAssignableFrom(type)) {
          String bean = type.getSimpleName();
          if (value instanceof String) {
            // the value is ID
            debug("form2To-- type=" + type);
            ModelObject mo = (ModelObject) type.newInstance();
            mo.setModelId((String) value);
            //                    ModelObject mo = getModelObject(bean, (String)value);
            _props.put(fn, mo);
          } else if (value instanceof Map) {
            Map<String, Object> cprops = (Map<String, Object>) value;
            ModelObject mo = (ModelObject) type.newInstance();
            form2To(mo, cprops);
            _props.put(fn, mo);
          } else {
            throw new RuntimeException(
                "Unknown value type: " + value + "," + value.getClass() + " bean:" + bean);
          }
        } else if (Collection.class.isAssignableFrom(type)) {
          Collection col = null;
          if (value != null) {
            if (MyPropertyUtil.isFieldCollectionOfModel(dest.getClass().getDeclaredField(fn))) {
              // NOTE: this means always Add/Update child ModelObject separately
              continue;
            } else {
              //                      String bean = config.getItemType(obj.getModelName(), fn);
              if (value instanceof String) {
                col = (Collection) PropertyUtils.getProperty(dest, fn);
                String val = (String) value;
                if (((String) val).indexOf(",") > 0) {
                  // for properties like Goods.categoryIds which is internally list of String,
                  // and submitted in the format of comma-separated string
                  // TODO escape ","
                  String[] values = ConvertUtil.split(val, ",");
                  col.addAll(Arrays.asList(values));
                } else {
                  col.add(value);
                }

              } else if (value instanceof Collection) {

                Collection c = (Collection) value;
                col = (Collection) PropertyUtils.getProperty(dest, fn);
                debug("size: " + c.size());
                col.addAll(c);
                //                            _props.put(fn, c);
              }
            }

            //            		else {
            ////                      throw new RuntimeException("Unknown value type: " +
            // value+","+value.getClass()+" bean:"+bean);
            //              		 throw new RuntimeException("Unknown value type: " +
            // value+","+value.getClass());
            //                  }
          } else {
            // keep the old value
            col = (Collection) PropertyUtils.getProperty(dest, fn);
          }
          //                _props.put(fn, col);
        } else {
          _props.put(fn, value);
        }
      }

      debug("form2To-- _props:" + _props);

      BeanUtils.populate(dest, _props);

    } catch (Exception e) {
      e.printStackTrace();
    }
  }