Beispiel #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;
 }
Beispiel #2
0
  public void putValue(int idx, Object ov) {
    String n = belongToDT.getColumnName(idx);
    if (n == null) throw new RuntimeException("no coloumn found with index=" + idx);

    if (ov != null) {
      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);
    } else this.remove(n);
  }
Beispiel #3
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);
      }
    }
  }
Beispiel #4
0
  public Object getValue(int idx) {
    String n = belongToDT.getColumnName(idx);
    if (n == null) return null;

    return this.get(n);
  }
Beispiel #5
0
 public boolean hasColumn(String coln) {
   return belongToDT.getColumn(coln) != null;
 }