SelectKey查询id
来源:互联网 发布:矢量动画制作软件 编辑:程序博客网 时间:2024/05/17 06:47
保存同时查询id,在user对象中,通过user.geiId取得id
keyProperty查询的主键是实体类的id属性
resultType = int.class是id的类型
三种方法:
@SelectKey(statement = “select LAST_INSERT_ID()”,keyProperty = “id”,before = false,resultType = int.class)
@SelectKey(statement = “select @@IDENTITY”,keyProperty = “id”,before = false,resultType = int.class)
@SelectKey(statement = “select max(id) id from tb_class”,keyProperty = “id”,before = false,resultType = int.class)
@Insert(“insert into tb_class(name) values(#{name}) “)
void save(User user);
阅读全文
0 0
- SelectKey查询id
- 用selectKey获取id值为负数
- SelectKey
- selectKey
- selectKey
- ibatis 的selectKey 实现插入数据后获得id
- spring+mybatis selectKey获取不到最后一个插入的ID
- mybatis入门使用3:selectKey返回最近插入的id
- mysql插入数据后返回自增ID的方法,last_insert_id(),selectkey
- mybatis 获取更新(update)记录的id 之< selectKey > 用法
- mysql函数之六:mysql插入数据后返回自增ID的方法,last_insert_id(),selectkey
- iBatis selectKey
- ibatis selectKey
- Mybatis - SelectKey
- selectKey标签
- 关于selectKey
- mysql insert一条记录(事务提交之前)怎样返回创建记录的主键id,last_insert_id(),selectkey && <select> 标签属性
- 两边关联id查询
- IMWeb提升营Day7 | 训练题39:平衡二叉树
- Android开发中 页面加载一张超大图片(561kb)时出现OOM
- #212. 矩阵
- Error:Unable to resolve target android-19
- 【c++基础】1.历史、IDE、概述
- SelectKey查询id
- map&reduce的用法
- 自定义ProgressBar(不随手机系统定制改变而改变)
- DXP快捷键整理
- linux系统下搭建NTP服务器
- 由Memcached使用不当而引发性能问题的两个经验总结
- 设计模式
- 正则:正则入门2.0:替换
- 多线程学习(一)