// 更新用户
<update id="updateUser" parameterType="com.domain.User">
update user set username=#{username},address=#{address},sex=#{sex},birthday=#{birthday} where id=#{id}
</update>
原因是在写Sql语句的时候//(双斜杠)注解Mybatis不识别
把注解改成 <!-- 更新用户-->就可以了
元素类型为 "mapper" 的内容必须匹配 " (cache-ref|cache|resultMap*|parameterMap*|sql*|insert*|update*delete*|selec
最新推荐文章于 2023-11-14 14:24:41 发布
本文介绍了一种在MyBatis中使用注释的正确方法,避免了SQL语句中//注释导致的问题,通过将注释更改为XML风格的注释<!-- -->,确保了代码的正常运行。
843

被折叠的 条评论
为什么被折叠?



