Package org.springframework.jdbc.core.namedparam

Examples of org.springframework.jdbc.core.namedparam.MapSqlParameterSource


//        " where gg_lbfp.fpid = gg_czyb_gwlb.gwid\n" +
//        "   and gg_czyb_gwlb.czyid = :GG_CZYID";
//    } else {
      sql = "select gg_lbfp.* from gg_lbfp  where fpid = :GG_CZYID";
//    }
    loginInfo.put(MyVisit.USER_GG_CZYLB, this.baseDaoEntity.getParaJdbcTemplate().queryForList(sql, new MapSqlParameterSource("GG_CZYID",gg_CZYB.getId())));
    loginInfo.put(MyVisit.DW_GG_JGBH, gg_JGBH_DW_Visit);
    loginInfo.put(MyVisit.LOGIN_TIME, DateUtil.getCurrentDateTimeView());
    Map mapPara = new HashMap();
    mapPara.put("SFDL", Constants_core.GG_CZYB_SFDL_YDL);
    mapPara.put("ID", gg_CZYB.getId());
View Full Code Here


      }
      return bookToStore;
   }

   private SqlParameterSource createParameterSourceFor(final Book book) {
      return new MapSqlParameterSource().addValue("id", book.getId())
               .addValue("isbn", book.getIsbn()).addValue("author", book.getAuthor())
               .addValue("title", book.getTitle());
   }
View Full Code Here

          + "        connect by prior t.fid = t.id) gn\n"
          + " start with gn.fid is null\n"
          + "connect by gn.fid = prior gn.id and  gn.id is not null\n"
          + " order by sort";
//    }
    List<Map> listXTGN = this.loginService.queryForList(sql, new MapSqlParameterSource("GG_CZYB_ID", myVisit.getCzy().getId()));
//    List<Map> listXTGNTemp = new ArrayList<Map>();
//    if (isGys() && (!isZSGLGys())) {
//      for (Map map : this.listXTGN) {
//        if (map.get("ID").equals("XT_ZSGL_ZSSFQR")) {
//        } else {
View Full Code Here

  public List<GG_XTGN> listResults(Pagination pagination) {
    String fid = ServletActionContext.getRequest().getParameter("fid");
    fid = fid == null ? "ROOT" : fid;
//    String sql = "select * from gg_xtgn where fid = '" + fid + "' order by sxh";
    String sql = "select id,jdmc,gndz,jdlb,fid from gg_xtgn where fid = :FID order by sxh";
    MapSqlParameterSource paramMap = new MapSqlParameterSource();
    paramMap.addValue("FID", fid);
    return xtgnglService.selectSplit(sql,paramMap,pagination);
  }
View Full Code Here

    if (jgbh == null || jgbh.length() == 0) {
      MyVisit myVisit = (MyVisit) ServletActionContext. getRequest().getSession().getAttribute("myVisit");
      jgbh = myVisit.getGG_JGBH().getJgbh();
    }
    String sql = "select id,mc,dlh from gg_czyb where jgbh = :JGBH and id != 'admin' order by gg_czyb.zcsj";
    MapSqlParameterSource paramMap = new MapSqlParameterSource();
    paramMap.addValue("JGBH", jgbh);
    return zzjgglService.selectSplit(sql,paramMap,pagination);
  }
View Full Code Here

   * @return the number of rows affected by the update
   */
  public int updateByNamedParam(Map<String, ?> paramMap) throws DataAccessException {
    validateNamedParameters(paramMap);
    ParsedSql parsedSql = getParsedSql();
    MapSqlParameterSource paramSource = new MapSqlParameterSource(paramMap);
    String sqlToUse = NamedParameterUtils.substituteNamedParameters(parsedSql, paramSource);
    Object[] params = NamedParameterUtils.buildValueArray(parsedSql, paramSource, getDeclaredParameters());
    int rowsAffected = getJdbcTemplate().update(newPreparedStatementCreator(sqlToUse, params));
    checkRowsAffected(rowsAffected);
    return rowsAffected;
View Full Code Here

   * @return the number of rows affected by the update
   */
  public int updateByNamedParam(Map<String, ?> paramMap, KeyHolder generatedKeyHolder) throws DataAccessException {
    validateNamedParameters(paramMap);
    ParsedSql parsedSql = getParsedSql();
    MapSqlParameterSource paramSource = new MapSqlParameterSource(paramMap);
    String sqlToUse = NamedParameterUtils.substituteNamedParameters(parsedSql, paramSource);
    Object[] params = NamedParameterUtils.buildValueArray(parsedSql, paramSource, getDeclaredParameters());
    int rowsAffected = getJdbcTemplate().update(newPreparedStatementCreator(sqlToUse, params), generatedKeyHolder);
    checkRowsAffected(rowsAffected);
    return rowsAffected;
View Full Code Here

  public void saveProduct(Product prod) {
    logger.info("Saving product: " + prod.getDescription());
    int count = getSimpleJdbcTemplate()
        .update(
            "update products set description = :description, price = :price where id = :id",
            new MapSqlParameterSource().addValue("description",
                prod.getDescription()).addValue("price",
                prod.getPrice()).addValue("id", prod.getId()));
    logger.info("Rows affected: " + count);
  }
View Full Code Here

  public int[] batchUpdate(String sql, Map[] batchValues) {
    SqlParameterSource[] batchArgs = new SqlParameterSource[batchValues.length];
    int i = 0;
    for (Map values : batchValues) {
      batchArgs[i] = new MapSqlParameterSource(values);
      i++;
    }
    return doExecuteBatchUpdateWithNamedParameters(sql, batchArgs);
  }
View Full Code Here

   * @return the number of rows affected by the update
   */
  public int updateByNamedParam(Map paramMap) throws DataAccessException {
    validateNamedParameters(paramMap);
    ParsedSql parsedSql = getParsedSql();
    MapSqlParameterSource paramSource = new MapSqlParameterSource(paramMap);
    String sqlToUse = NamedParameterUtils.substituteNamedParameters(parsedSql, paramSource);
    Object[] params = NamedParameterUtils.buildValueArray(parsedSql, paramSource, getDeclaredParameters());
    int rowsAffected = getJdbcTemplate().update(newPreparedStatementCreator(sqlToUse, params));
    checkRowsAffected(rowsAffected);
    return rowsAffected;
View Full Code Here

TOP

Related Classes of org.springframework.jdbc.core.namedparam.MapSqlParameterSource

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.