zoukankan      html  css  js  c++  java
  • 传入mybatis的xml为Long型时报There is no getter for property named 'VARCHAR' in

    修改前

      <insert id="insert" parameterType="com.taotao.pojo.TbContent" >
        insert into tb_content (id, category_id, title,
          sub_title, title_desc, url,
          pic, pic2, created,
          updated, content)
        values (${id,jdbcType=BIGINT}, ${categoryId,jdbcType=BIGINT}, ${title,jdbcType=VARCHAR},
         ${subTitle,jdbcType=VARCHAR}, ${titleDesc,jdbcType=VARCHAR}, ${url,jdbcType=VARCHAR},
          ${pic,jdbcType=VARCHAR}, ${pic2,jdbcType=VARCHAR}, ${created,jdbcType=TIMESTAMP},
          ${updated,jdbcType=TIMESTAMP},${content,jdbcType=LONGVARCHAR})
      </insert>

    修改后

      <insert id="insert" parameterType="com.taotao.pojo.TbContent" >
        insert into tb_content (id, category_id, title,
          sub_title, title_desc, url,
          pic, pic2, created,
          updated, content)
        values (#{id,jdbcType=BIGINT}, #{categoryId,jdbcType=BIGINT}, #{title,jdbcType=VARCHAR},
          #{subTitle,jdbcType=VARCHAR}, #{titleDesc,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR},
          #{pic,jdbcType=VARCHAR}, #{pic2,jdbcType=VARCHAR}, #{created,jdbcType=TIMESTAMP},
          #{updated,jdbcType=TIMESTAMP}, #{content,jdbcType=LONGVARCHAR})
      </insert>

     主要是#{}和${}的区别 如果不懂的可以点击查看Mybatis中#{}和${}传参的区别及#和$的区别小结

  • 相关阅读:
    Elasticsearch 安全功能现免费提供(从 6.8.0 和 7.1.0 版本开始)
    redis5.0.0安装
    java归并排序
    java Shell排序
    java折半插入排序
    java插入排序
    java快速排序
    Android onSaveInstanceState()
    Android Intent传递数据
    Android Intent的花样启动
  • 原文地址:https://www.cnblogs.com/zqr99/p/8093359.html
Copyright © 2011-2022 走看看