Package org.springframework.jdbc.core.namedparam

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


   * @return
   */
  @TriggersRemove(cacheName = "codeCache", removeAll = true)
  public int insertCode(Code code) {
    String sql = "insert into sys_code(group_name,`key`,`value`,parent_key,last_modify) values (:groupName,:key,:value,:parentKey,now())";
    SqlParameterSource paramMap = new BeanPropertySqlParameterSource(code);
    return namedParameterJdbcTemplate.update(sql, paramMap);
  }
View Full Code Here


   * @return
   */
  public int insertPushRecord(PushRecord pushRecord) {
    String sql = "insert into bu_push_record(indexid,docid,modelname,title,lspri,url,sub_title,add_date,last_modify,modify_user,topicid,type,img )"
        + " values(:indexid,:docid,:modelName,:title,:lspri,:url,:subTitle,now(),now(),:modifyUser,:topicid,:type,:img)";
    SqlParameterSource paramMap = new BeanPropertySqlParameterSource(pushRecord);
    return namedParameterJdbcTemplate.update(sql, paramMap);
  }
View Full Code Here

  public int updatePushRecord(PushRecord pushRecord) {
    String sql = "update bu_push_record set modelname=:modelName,title=:title,"
        + "lspri=:lspri,url=:url,sub_title=:subTitle,last_modify = now(),"
        + "modify_user=:modifyUser,topicid=:topicid,img=:img "
        + "where indexid=:indexid";
    SqlParameterSource paramMap = new BeanPropertySqlParameterSource(pushRecord);
    return namedParameterJdbcTemplate.update(sql, paramMap);
  }
View Full Code Here

  public int insertPushRecords(List<PushRecord> list) {
    String sql = "insert into bu_push_record(docid,modelname,title,lspri,url,sub_title,add_date,last_modify,modify_user,topicid,type,img )"
        + " values(:docid,:modelName,:title,:lspri,:url,:subTitle,now(),now(),:modifyUser,:topicid,:type,:img)";
    SqlParameterSource[] paramMap  = new SqlParameterSource[list.size()];
    for (int i = 0; i < paramMap.length; i++) {
      paramMap[i] = new BeanPropertySqlParameterSource(list.get(i));
    }
    return namedParameterJdbcTemplate.batchUpdate(sql, paramMap).length;
  }
View Full Code Here

   * @return
   */
  public int insertModel(Model model) {
    String sql = "insert into bu_model(model_name,content,last_modify,del,modify_user,type,url,title,keyword,topicid,extname,add_time,status)"
        + " values(:modelName,:content,now(),:delete,:modifyUser,:type,:url,:title,:keyword,:topicid,:extname,now(),status)";
    SqlParameterSource paramMap = new BeanPropertySqlParameterSource(model);
    return namedParameterJdbcTemplate.update(sql, paramMap);
  }
View Full Code Here

   * @return
   */
  public int insertModelRefresh(Model model) {
    String sql = "insert into bu_model_refresh(model_name,rate,time_out)"
        + " values(:modelName,:rate,:timeout)";
    SqlParameterSource paramMap = new BeanPropertySqlParameterSource(model);
    return namedParameterJdbcTemplate.update(sql, paramMap);
  }
View Full Code Here

   * @return
   */
  public int updateModel(Model model) {
    String sql = "update bu_model set content=:content,last_modify=:lastModify,modify_user=:modifyUser,title=:title,keyword=:keyword,extname=:extname"
        + ",status=:status,url =:url where model_name=:modelName";
    SqlParameterSource paramMap = new BeanPropertySqlParameterSource(model);
    return namedParameterJdbcTemplate.update(sql, paramMap);
  }
View Full Code Here

   * @param model
   * @return
   */
  public int updateModelRefresh(Model model) {
    String sql = "update bu_model_refresh set rate=:rate,time_out=:timeout where model_name = :modelName";
    SqlParameterSource paramMap = new BeanPropertySqlParameterSource(model);
    return namedParameterJdbcTemplate.update(sql, paramMap);
  }
View Full Code Here

   * @return
   */
  public int insertTopic(Topic topic) {
    String sql = "insert into bu_topic(topicid,topic_name,last_modify,modify_user,topic_tree,parent_topic,topic_nav)"
        + " values (:topicId,:topicName,now(),:modifyUser,:topicTree,:parentTopic,:topicNav)";
    SqlParameterSource paramMap = new BeanPropertySqlParameterSource(topic);
    return namedParameterJdbcTemplate.update(sql, paramMap);
  }
View Full Code Here

   * @return
   */
  public int updateTopic(Topic topic) {
    String sql = "update bu_topic set topic_name = :topicName, topic_nav = :topicNav, modify_user=:modifyUser,last_modify = now() "
        + "where topicid=:topicId";
    SqlParameterSource paramMap = new BeanPropertySqlParameterSource(topic);
    return namedParameterJdbcTemplate.update(sql, paramMap);
  }
View Full Code Here

TOP

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

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.