Package org.springframework.jdbc.core

Examples of org.springframework.jdbc.core.RowMapper


        " WHERE (isdeleted='0') AND (objtype = 'form' AND prodver <> 0) OR (objtype = 'folder')").toString();
   
    final AclManager aclManager = AclManager.getInstance();
   
    return this.jdbcTemplate.query(sql,
        new RowMapper() {
          public Object mapRow(ResultSet rs, int rowNum) throws SQLException {
            Item item = null;
           
            int defid = rs.getInt("defid");
           
View Full Code Here


       .append("  FROM  bpm_procdef       ").append("\n")
       .append(" WHERE  isdeleted = 0     ").append("\n")
       .append("   AND  objtype = 'folder'").append("\n")
       .append("   AND  comcode = '").append(comCode).append("'").append("\n");
   
    final List<Item> itemList = this.jdbcTemplate.query(sql.toString(), new RowMapper() {
      public Object mapRow(ResultSet rs, int rowNum) throws SQLException {
        Item item = null;
       
        int defid = rs.getInt("defid");
        String name = rs.getString("name");
View Full Code Here

  @SuppressWarnings("unchecked")
  public List<Integer> getInstanceIdListById(Serializable id) {
    StringBuilder sql = new StringBuilder("");
    sql.append(" select * from BPM_PROCINST WHERE STRATEGYID = ? ");
   
    return this.jdbcTemplate.query(sql.toString(), new Object[] { id }, new RowMapper() {
      public Object mapRow(ResultSet rs, int arg1) throws SQLException {
        int instanceId = rs.getInt("INSTID");
        return instanceId;
      }
    });
View Full Code Here

      ss.append(String.valueOf(ids.get(i)));
    }
   
    sql.append(" select * from BPM_PROCINST WHERE STRATEGYID in ("+ss+") ");
   
    return this.jdbcTemplate.query(sql.toString(), new Object[] {}, new RowMapper() {
      public Object mapRow(ResultSet rs, int arg1) throws SQLException {
        Instance instance = new Instance();
        instance.setId(""+ rs.getInt("INSTID") );
        instance.setStatus(rs.getString("STATUS"));
        return instance;
View Full Code Here

    sql.append(" LEFT JOIN parttable as p ON a.partcode = p.partcode ");
    sql.append(" LEFT JOIN emptable as e ON a.empcode = e.empcode ");
    sql.append(" LEFT JOIN roletable as r ON a.rolecode = r.rolecode ");
    sql.append(" WHERE a.defid = ? ");
   
    return this.jdbcTemplate.query(sql.toString(), new Object[] { defId }, new RowMapper() {
      public Object mapRow(ResultSet rs, int rowNum) throws SQLException {
        Authority authority = new Authority();
       
        authority.setAclid(rs.getString("acltableid"));
        authority.setComcode(rs.getString("comcode"));
View Full Code Here

    }
    if ("MYSQL".equals(typeOfDBMS)) {
      sb.append("  limit ").append(listLength);
    }
   
    return this.jdbcTemplate.query(sb.toString(), new RowMapper() {
      public Object mapRow(ResultSet rs, int rowNum) throws SQLException {
        DashboardWorkList dashboardWorklist = new DashboardWorkList();
        dashboardWorklist.setInstId(rs.getInt("instId"));
        dashboardWorklist.setTrcTag(rs.getString("trcTag"));
        dashboardWorklist.setTaskId(rs.getInt("taskId"));
View Full Code Here

   * @return a List of objects, one per row of the ResultSet. Normally all these
   * will be of the same class, although it is possible to use different types.
   */
  public List execute(Object[] params, Map context) throws DataAccessException {
    validateParameters(params);
    RowMapper rowMapper = newRowMapper(params, context);
    return getJdbcTemplate().query(newPreparedStatementCreator(params), rowMapper);
  }
View Full Code Here

    validateNamedParameters(paramMap);
    ParsedSql parsedSql = getParsedSql();
    MapSqlParameterSource paramSource = new MapSqlParameterSource(paramMap);
    String sqlToUse = NamedParameterUtils.substituteNamedParameters(parsedSql, paramSource);
    Object[] params = NamedParameterUtils.buildValueArray(parsedSql, paramSource, getDeclaredParameters());
    RowMapper rowMapper = newRowMapper(params, context);
     return getJdbcTemplate().query(newPreparedStatementCreator(sqlToUse, params), rowMapper);
  }
View Full Code Here

    NamedParameterJdbcTemplate template = new NamedParameterJdbcTemplate(mockDataSource);

    MapSqlParameterSource parms = new MapSqlParameterSource();
    parms.addValue("id", new Integer(3));

    Object o = template.queryForObject(sql, parms, new RowMapper() {
      public Object mapRow(ResultSet rs, int rowNum) throws SQLException {
        return new Integer(rs.getInt(1));
      }
    });
    assertTrue("Correct result type", o instanceof Integer);
View Full Code Here

    NamedParameterJdbcTemplate jt = new NamedParameterJdbcTemplate(mockDataSource);
    Map params = new HashMap();
    params.put("id", new SqlParameterValue(Types.DECIMAL, new Integer(1)));
    params.put("country", "UK");
    List customers = jt.query(SELECT_NAMED_PARAMETERS, params, new RowMapper() {
      public Object mapRow(ResultSet rs, int rownum) throws SQLException {
        Customer cust = new Customer();
        cust.setId(rs.getInt(COLUMN_NAMES[0]));
        cust.setForename(rs.getString(COLUMN_NAMES[1]));
        return cust;
View Full Code Here

TOP

Related Classes of org.springframework.jdbc.core.RowMapper

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.