当前位置: 首页 > 工具软件 > BBX > 使用案例 >

@。Could not find result map com.bbx.springmvc.pojo.User

水品
2023-12-01

Could not complete request
org.apache.ibatis.builder.IncompleteElementException: Could not find result map com.bbx.springmvc.pojo.User

意思:返回的结果和类型不一致。
出现问题在mapper上
错误:

<mapper namespace="com.bbx.springmvc.dao.UserMapper">
        <resultMap id="user" type="com.bbx.springmvc.pojo.User">
            <id property="id" column="id"/>
            <result property="username" column="username"/>
            <result property="password" column="password"/>
        </resultMap>
<select id="selectUserByusername" parameterType="String" resultMap="**com.bbx.springmvc.pojo.User**">
        select * from user where username=#{username};
    </select>

正确:

<mapper namespace="com.bbx.springmvc.dao.UserMapper">
        <resultMap id="user" type="com.bbx.springmvc.pojo.User">
            <id property="id" column="id"/>
            <result property="username" column="username"/>
            <result property="password" column="password"/>
        </resultMap>
<select id="selectUserByusername" parameterType="String" resultMap="**user**">
        select * from user where username=#{username};
    </select>
 类似资料:

相关阅读

相关文章

相关问答