【mybatis】mybatis中insert 主键自增和不自增的插入情况【mysql】

时间:2018-06-08 10:23:16   收藏:0   阅读:555

 

主键不自增:返回值是插入的条数

<insert id="add" parameterType="EStudent">
  insert into TStudent(name, age) values(#{name}, #{age})
</insert

 

主键自增:

<insert id="add" parameterType="EStudent" useGeneratedKeys="true" keyProperty="id">
  insert into TStudent(name, age) values(#{name}, #{age})
</insert>

 

原文:https://www.cnblogs.com/sxdcgaq8080/p/9153805.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!