Examples of CDERow


Examples of org.apache.oodt.xmlps.structs.CDERow

            if (res == null
                    || (res != null && (res.getRows() == null || (res.getRows() != null && res
                            .getRows().size() == 0)))) {
                newRes = new CDEResult();
                // add one row
                newRes.getRows().add(new CDERow());
            }

            for (Iterator<QueryElement> i = constFlds.iterator(); i.hasNext();) {
                QueryElement elem = i.next();
                MappingField fld = this.mapping.getFieldByLocalName(elem
                        .getValue());

                for (Iterator<CDERow> j = newRes.getRows().iterator(); j
                        .hasNext();) {
                    CDERow row = j.next();
                    CDEValue val = new CDEValue(fld.getName(), fld
                            .getConstantValue());
                    row.getVals().add(val);
                }
            }
        }

        return newRes;
View Full Code Here

Examples of org.apache.oodt.xmlps.structs.CDERow

      ResultSet rs = statement.executeQuery(sql);

      result = new CDEResult();

      while (rs.next()) {
        CDERow row = toCDERow(rs, map, returnNames);
        result.getRows().add(row);
      }

    } catch (SQLException e) {
      e.printStackTrace();
View Full Code Here

Examples of org.apache.oodt.xmlps.structs.CDERow

    return result;

  }

  private CDERow toCDERow(ResultSet rs, Mapping map, List<String> returnNames) {
    CDERow row = new CDERow();
    if (returnNames != null && returnNames.size() > 0) {
      for (Iterator<String> i = returnNames.iterator(); i.hasNext();) {
        String retName = i.next();
        MappingField fld = map.getFieldByLocalName(retName);
        // only handle dynamic fields here
        // if it was a constant field, then it will be dealt with
        // later
        if (fld.getType().equals(FieldType.DYNAMIC)) {
          // go ahead and add it in
          try {
            String elemDbVal = rs.getString(retName);
            for (Iterator<MappingFunc> j = fld.getFuncs().iterator(); j
                .hasNext();) {
              MappingFunc func = j.next();
              CDEValue origVal = new CDEValue(fld.getName(), elemDbVal);
              CDEValue newVal = func.inverseTranslate(origVal);
              elemDbVal = newVal.getVal();
            }

            row.getVals().add(new CDEValue(fld.getName(), elemDbVal));
          } catch (SQLException e) {
            LOG.log(Level.WARNING, "Unable to obtain field: [" + retName
                + "] from result set: message: " + e.getMessage());
          }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.