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

<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>

 

相关文章:

  • 2022-12-23
  • 2022-02-07
  • 2021-06-19
  • 2021-12-10
  • 2022-01-12
  • 2022-01-28
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-05-13
  • 2021-06-16
  • 2022-12-23
  • 2022-12-23
  • 2021-06-08
  • 2021-10-05
  • 2022-12-23
相关资源
相似解决方案