修改前

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

传入mybatis的xml为Long型时报There is no getter for property named 'VARCHAR' in的更多相关文章

  1. Mybatis找不到参数错误:There is no getter for property named 'categoryId' in 'class java.lang.Integer'。

    Mybatis找不到参数错误:There is no getter for property named 'categoryId' in 'class java.lang.Integer'. 错误Li ...

  2. 【MyBatis学习06】_parameter:解决There is no getter for property named in class java.lang.String

    我们知道在mybatis的映射中传参数,只能传入一个.通过#{参数名} 即可获取传入的值. Mapper接口文件: public int delete(int id) throws Exception ...

  3. mybatis之org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'time' in 'class java.lang.String'

    mybatis接口 List<String> getUsedCate(String time); 配置文件 <select id="getUsedCate" pa ...

  4. mybatis的if标签判断子类属性-There is no getter for property named 'export' in

    1 <select id="findList" resultType="BndExport"> SELECT <include refid=& ...

  5. MyBatis查询传一个参数时报错:There is no getter for property named 'sleevetype' in 'class java.lang.Integer

    用MyBatis进行查询,传入参数只有一个时(非Map)如int,报错 There is no getter for property named 'sleevetype' in 'class jav ...

  6. Mybatis 传入List类型参数,报错:There is no getter for property named '__frch_item_0' in

    错误如下: org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.Re ...

  7. mybatis 错误: There is no getter for property named '*' in 'class java.lang.String解决

    现象: mybatis mapper.xml 的sql里如果直接使用了想要传入的变量,比如: <select id="selectXx" resultType="i ...

  8. Mybatis笔记四:nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'id' in 'class java.lang.String'

    错误异常:nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for pr ...

  9. mybatis There is no getter for property named 'xx' in 'class java.lang.String

    转载自://http://www.cnblogs.com/anee/p/3324140.html 用mybatis查询时,传入一个字符串传参数,且进行判断时,会报 There is no getter ...

随机推荐

  1. One-hot encoding 独热编码

    http://blog.sina.com.cn/s/blog_5252f6ca0102uy47.html

  2. thinkphp5 如何监听sql?

    第一步 在database配置文件中开启 // 是否需要进行SQL性能分析'sql_explain' => true, 第二步 在需要测试的sql前,使用以下demo Db::listen(fu ...

  3. 关于angular1与angular2的应用区别

    angular1.0的这些繁杂的api,还有它的执行速度,运行效率,学习曲线,都被人吐槽,最近一直在用ng1,实在很想吐槽. 最近写ng2的项目,写了一些ng2基础的应用(包括angular-cli, ...

  4. 洛谷P2486 染色

    LCT的一种姿势. 题意:给定一棵树.每次把一条路径上的点染成一种颜色,求一条路径上有多少段颜色. 解: 首先可以很轻易的用树剖解决,只不过代码量让人望而却步... 有一种难以想象的LCT做法... ...

  5. A1134. Vertex Cover

    A vertex cover of a graph is a set of vertices such that each edge of the graph is incident to at le ...

  6. 【NOIP数论内容整理】

    转载{大佬传送门} 附赠wakelin一句评论:日均二百七,全场rank1:千古神犇ZAY,吊打清华钟皓曦%%%

  7. Java Scanner篇

    Scanner 翻译解释为扫描器 Java中用于控制台的的数据输入 包:import java.util.Scanner 使用方法:Scanner reader=new Scanner(System. ...

  8. MySQL填充字符串函数 LPAD(str,len,padstr),RPAD(str,len,padstr)

    转: MySQL填充字符串函数 LPAD(str,len,padstr),RPAD(str,len,padstr) LPAD(str,len,padstr) 用字符串 padstr对 str进行左边填 ...

  9. struts2 contextMap

    一.contextMap中的数据操作 root根:List 元素1 元素2 元素3 元素4 元素5 contextMap:Map key value application Map key value ...

  10. struts2 二: 参数封装

    封装请求正文到对象中(非常重要) 1.静态参数封装 在struts.xml配置文件中,给动作类注入值.调用的是setter方法. struts.xml的编写: <action name=&quo ...