mybatis 插入语句name no find

时间:2021-01-01 05:43:34

1、可参考连接:https://www.cnblogs.com/thomas12112406/p/6217211.html

2、dao层的配置

void addUser(@Param("uname") String uname,
@Param("phone") String phone,
@Param("address") String address,
@Param("header") String header,
@Param("motto") String motto,
@Param("nickname") String nickname,
@Param("hobbies") String hobbies);

  

3、mybatis插入语法结构

<insert id="addUser" parameterType="User" useGeneratedKeys="true">
insert into userinfo (uname, phone, address, header, motto, nickname, hobbies) values (#{uname}, #{phone}, #{address}, #{header}, #{motto}, #{nickname}, #{hobbies})
</insert>