1     <!--插入-->
2     <insert id="insertMessage" parameterType="message" useGeneratedKeys="true" keyProperty="id">
3         INSERT INTO message (command, description, content) VALUES (#{command},#{description},#{content})
4     </insert>

 

会将MySQL生成的自增序列主键赋值给message的id属性

相关文章:

  • 2021-09-24
  • 2022-12-23
  • 2021-11-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-05
  • 2022-01-02
  • 2022-12-23
  • 2021-11-07
  • 2022-12-23
相关资源
相似解决方案