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; }
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); }
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); } } }
public Object getValue(int idx) { String n = belongToDT.getColumnName(idx); if (n == null) return null; return this.get(n); }
public boolean hasColumn(String coln) { return belongToDT.getColumn(coln) != null; }