lineNumber: 8; columnNumber: 48; 元素类型为 “id“ 的内容必须匹配 “EMPTY“。

今天在看尚硅谷的mybatis的时候,突然发现一个错误,(代码对比过和老师的一模一模), 我找了大半天都没有找到错误。后面终于发现mybatis的标签所导致的。

问题:
lineNumber: 8; columnNumber: 48; 元素类型为 “id” 的内容必须匹配 “EMPTY”。
在这里插入图片描述

有问题的部分:

        
        <id property="eid"  column="eid"> </id>
        <result property="empName" column="emp_name"></result>
        <result property="sex" column="sex"></result>
        <result property="email" column="email"></result>
        <result property="age" column="age"></result>

更改后如下:

    <resultMap id="empReusltMap" type="com.atguigu.mybatis.pojo.Emp">
        <id property="eid"  column="eid"/>
        <result property="empName" column="emp_name"/>
        <result property="sex" column="sex"/>
        <result property="email" column="email"/>
        <result property="age" column="age"/>
    </resultMap>

运行成功:

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_46051303/article/details/128351372