请问老师我的useGeneratedKey keyProperty keyColumn都标红且拼写还没有提示是什么原因呢?
Attribute useGeneratedKeys is not allowed here
Attribute useGeneratedKeys is not allowed here
2021-06-02
将外部的<select>改为<insert>即可,<select>中是没有这几个值的。
例:
<select id="addUser"> insert into mybatis.user (id,name,password) values (#{id},#{name},#{password}) </select>
改为
<insert id="addUser" useGeneratedKeys="true" keyProperty="id"> insert into mybatis.user (id,name,password) values (#{id},#{name},#{password}) </insert>
举报