Package org.springframework.jdbc.core.namedparam

Examples of org.springframework.jdbc.core.namedparam.MapSqlParameterSource.addValue()


    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);
  }
 
  public String delete() {
    String ids = ServletActionContext.getRequest().getParameter("id");
View Full Code Here


      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);
  }
 
  public String delete() {
    String ids = ServletActionContext.getRequest().getParameter("id");
View Full Code Here

    testDelegation("queryForList", new Object[]{"sql"}, new Object[]{args}, new LinkedList());
  }

  public void testQueryForListWithSqlParameterSource() throws Exception {
    MapSqlParameterSource args = new MapSqlParameterSource();
    args.addValue("1", 1);
    args.addValue("2", 2);
    args.addValue("3", 3);
    testDelegation("queryForList", new Object[]{"sql"}, new Object[]{args}, new LinkedList());
  }
View Full Code Here

  }

  public void testQueryForListWithSqlParameterSource() throws Exception {
    MapSqlParameterSource args = new MapSqlParameterSource();
    args.addValue("1", 1);
    args.addValue("2", 2);
    args.addValue("3", 3);
    testDelegation("queryForList", new Object[]{"sql"}, new Object[]{args}, new LinkedList());
  }

  public void testQueryForMapWithoutArgs() throws Exception {
View Full Code Here

  public void testQueryForListWithSqlParameterSource() throws Exception {
    MapSqlParameterSource args = new MapSqlParameterSource();
    args.addValue("1", 1);
    args.addValue("2", 2);
    args.addValue("3", 3);
    testDelegation("queryForList", new Object[]{"sql"}, new Object[]{args}, new LinkedList());
  }

  public void testQueryForMapWithoutArgs() throws Exception {
    testDelegation("queryForMap", new Object[]{"sql"}, new Object[]{}, new HashMap());
View Full Code Here

    testDelegation("queryForMap", new Object[]{"sql"}, new Object[]{args}, new HashMap());
  }

  public void testQueryForMapWithSqlParameterSource() throws Exception {
    MapSqlParameterSource args = new MapSqlParameterSource();
    args.addValue("1", 1);
    args.addValue("2", 2);
    args.addValue("3", 3);
    testDelegation("queryForMap", new Object[]{"sql"}, new Object[]{args}, new HashMap());
  }
View Full Code Here

  }

  public void testQueryForMapWithSqlParameterSource() throws Exception {
    MapSqlParameterSource args = new MapSqlParameterSource();
    args.addValue("1", 1);
    args.addValue("2", 2);
    args.addValue("3", 3);
    testDelegation("queryForMap", new Object[]{"sql"}, new Object[]{args}, new HashMap());
  }

  public void testUpdateWithoutArgs() throws Exception {
View Full Code Here

  public void testQueryForMapWithSqlParameterSource() throws Exception {
    MapSqlParameterSource args = new MapSqlParameterSource();
    args.addValue("1", 1);
    args.addValue("2", 2);
    args.addValue("3", 3);
    testDelegation("queryForMap", new Object[]{"sql"}, new Object[]{args}, new HashMap());
  }

  public void testUpdateWithoutArgs() throws Exception {
    testDelegation("update", new Object[]{"sql"}, new Object[]{}, 666);
View Full Code Here

    testDelegation("update", new Object[]{"sql"}, new Object[]{args}, 666);
  }

  public void testUpdateWithSqlParameterSource() throws Exception {
    MapSqlParameterSource args = new MapSqlParameterSource();
    args.addValue("1", 1);
    args.addValue("2", 2);
    args.addValue("3", 3);
    testDelegation("update", new Object[]{"sql"}, new Object[]{args}, 666);
  }
View Full Code Here

  }

  public void testUpdateWithSqlParameterSource() throws Exception {
    MapSqlParameterSource args = new MapSqlParameterSource();
    args.addValue("1", 1);
    args.addValue("2", 2);
    args.addValue("3", 3);
    testDelegation("update", new Object[]{"sql"}, new Object[]{args}, 666);
  }

  private Object testDelegation(String methodName, Object[] typedArgs, Object[] varargs, Object expectedResult) throws Exception {
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.