mybatis
文章平均质量分 58
LiuLei_2015
这个作者很懒,什么都没留下…
展开
-
mybatis if test 语句中0 == ‘‘ 为什么会成立?
mybatis if test用法踩坑 一个bug引发的思考 mybatis使用if test时,需要谨慎判断数据的类型,否则会引起不必要的麻烦: 踩坑案例如下: <update id="updateBaiduVo" parameterType="com.baidu.TestVo"> update tbl_user <set> <if test="age != null and age != ''">原创 2021-07-07 20:47:33 · 628 阅读 · 0 评论 -
Mybatis selectKey获取自增主键总是null
一、遇到的坑:selectKey 返回的主键总是null 按照网上帖子说的方式配置了insert语句返回自增主键的查询。如下: <insert id="insertxxxx" parameterType="com.xxx.xxx.entity.XXXXEntity"> <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer"> SELECT LAST_INS原创 2021-05-10 14:06:46 · 1584 阅读 · 3 评论