mysql的myBatis,主键自增设置
2024-10-19 06:30:48
方法一:
insert id="insert" parameterType="Person" useGeneratedKeys="true" keyProperty="id">
insert into person(name,pswd) values(#{name},#{pswd})
</insert>
方法二:
<insert id="insert" parameterType="Person">
<selectKey keyProperty="id" resultType="long">
select LAST_INSERT_ID()
</selectKey>
insert into person(name,pswd) values(#{name},#{pswd})
</insert>
最新文章
- Tornado学习笔记12 tornado.httpserver-.非阻塞的Http服务器
- C# Susan边缘检测(Susan Edge Detection)
- Linux_vi编辑器
- Memcached 笔记与总结(9)Memcached 与 Session
- D3.js 让图表动起来
- struts2内Action方法调用
- C# 自定义事件
- 菜鸟学Java(十九)——WEB项目測试好帮手,Maven+Jetty
- 【转】Android官方下拉刷新控件 SwipeRefreshLayout
- c# 强制退出程序
- maven 阿里云仓库配置
- DAY11-Java中的类--接上篇
- bzoj2131 免费的馅饼——树状数组优化dp
- (网页)jquery-qrcode.js生成二维码
- POJ 2823 Sliding Window (单调队列)
- 使用java操作kudu
- 洛谷 P2596 [ZJOI2006]书架 解题报告
- Spring学习笔记--Spring配置文件和依赖注入
- zgrep用法
- CSS常用样式属性