zoukankan      html  css  js  c++  java
  • org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: org.apache.ibatis.build

    使用SSM框架,添加一个新的Mapper.xml文件后,运行项目报错:

    org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'Blog'.  Cause: java.lang.ClassNotFoundException: Cannot find class: Blog

    开始我的Mapper是这样设置的:

    <mapper namespace="com.online.dao.BlogDao">
        <!--保存Blog-->
        <insert id="saveBlog" parameterType="Blog">
           insert into blog(title,summary,content,htmlContent)values(#{title},#{summary},#{content},#{htmlContent});
        </insert>
    </mapper>

    原因是因为parameterType的路径不是完整路径,改为完整路径就可以了。

    <mapper namespace="com.online.dao.BlogDao">
        <!--保存Blog-->
        <insert id="saveBlog" parameterType="com.online.domain.Blog">
            <selectKey keyProperty="id" keyColumn="id" resultType="int" order="AFTER">
                select last_insert_id();
            </selectKey>
            insert into blog(title,summary,content,htmlContent)values(#{title},#{summary},#{content},#{htmlContent});
        </insert>
    </mapper>
  • 相关阅读:
    VS2010 正则批量替换头文件路径
    VC++ 内存泄露与检测的一种方法
    命令行编译C++程序
    Link1123:转换到COFF期间失败:文件无效或损坏
    C语言基础知识
    PCL深度图像(2)
    PCL关键点(1)
    PCL采样一致性算法
    PCL滤波介绍(3)
    PCL滤波介绍(2)
  • 原文地址:https://www.cnblogs.com/mxxbc/p/14039016.html
Copyright © 2011-2022 走看看