Package org.springframework.xd.tuple

Examples of org.springframework.xd.tuple.TupleBuilder


  @Override
  public void afterPropertiesSet() throws Exception {
    setRowMapper(new RowMapper<Tuple>() {
      @Override
      public Tuple mapRow(ResultSet rs, int rowNum) throws SQLException {
        TupleBuilder builder = TupleBuilder.tuple();

        for (int i=1; i <= rs.getMetaData().getColumnCount(); i++) {
          String name = JdbcUtils.lookupColumnName(rs.getMetaData(), i);
          builder.put(name, JdbcUtils.getResultSetValue(rs, i, String.class));
        }

        return builder.build();
      }
    });

    super.afterPropertiesSet();
  }
View Full Code Here


   */
  @Override
  public Tuple mapRow(ResultSet rs, int rowNum) throws SQLException {
    int columnCount = rs.getMetaData().getColumnCount();

    TupleBuilder builder = TupleBuilder.tuple();

    for (int i = 1; i <= columnCount; i++) {
      builder.put(rs.getMetaData().getColumnName(i), JdbcUtils.getResultSetValue(rs, i));
    }

    return builder.build();
  }
View Full Code Here

   */
  @Override
  public Tuple mapFieldSet(FieldSet fieldSet) throws BindException {
    String[] names = fieldSet.getNames();

    TupleBuilder builder = TupleBuilder.tuple();

    if (dateFormat != null) {
      builder.setDateFormat(dateFormat);
    }

    for (int i = 0; i < fieldSet.getFieldCount(); i++) {
      builder.put(names[i], getValue(fieldSet, names[i]));
    }

    return builder.build();
  }
View Full Code Here

TOP

Related Classes of org.springframework.xd.tuple.TupleBuilder

Copyright © 2018 www.massapicom. 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.