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中#{}和${}传参的区别及#和$的区别小结

  • 相关阅读:
    Div高度百分比
    字典树模板题 POJ 2503
    POJ 2828
    POJ 2186
    HDU 3397 双lazy标记的问题
    HDU 3911 区间合并求最大长度的问题
    CodeForces 444C 节点更新求变化值的和
    POJ 3667 线段树的区间合并简单问题
    HDU 4578 线段树复杂题
    UVAlive 3211 Now or Later
  • 原文地址:https://www.cnblogs.com/zqr99/p/8093359.html
Copyright © 2011-2022 走看看