示例#1
0
 public XmlData toXmlData() {
   XmlData xd = new XmlData();
   for (DataColumn dc : belongToDT.getColumns()) {
     String n = dc.getName();
     Object o = this.getValue(n);
     if (o != null) xd.setParamValue(n, o);
   }
   return xd;
 }
示例#2
0
  public void fromXmlData(XmlData xd) {
    for (DataColumn dc : belongToDT.getColumns()) {
      String n = dc.getName();
      Object ov = xd.getParamValue(n);
      if (ov != null) { // 适应jdbc数据库访问要求
        if ((ov instanceof java.util.Date) && !(ov instanceof java.sql.Timestamp)) {
          ov = new java.sql.Timestamp(((java.util.Date) ov).getTime());
        }

        this.put(n, ov);
      }
    }
  }