共 40 篇文章 |
|
阅2 转自binggelib... 公众公开 16-10-29 14:55 |
Mybatis传多个参数(三种解决方案)<select id=" selectUser" resultMap="BaseResultMap"> select * from user_user_t where user_name = #{userName,jdbcType=VARCHAR} and user_area=#{userArea,jdbcType=VARCHAR}</select>paramMap.put(“userName”,”对应具体的参数值”);paramMap.put(“userArea”,”... 阅14 转0 评0 公众公开 15-09-22 18:02 |
Mybatis like查询的写法。Mybatis like查询官方文档没有明确的例子可循,网上搜索了很多,都不正确。select * from person where name like "%"#{name}"%"select * from person where name like ''%''||#{name}||''%''select * from person where name like ''%${name}%'&... 阅948 转0 评0 公众公开 15-09-22 18:00 |
<update id="updateTestcaseNodeBatch" parameterType="List"> <foreach collection="list" item="nodeVO"> UPDATE testcase_node <set> name=#{nodeVO.name}, version=#{nodeVO.version}, description=#{nodeVO.description}, last_modify_user=#{nodeVO.createUser}, last_modify... 阅179 转0 评0 公众公开 15-09-09 14:03 |
MyBatis的几种批量操作MyBatis中批量插入。例如:insert into XX_TABLE(XX,XX,XX)select ''xx'',''xx'',''xx'' union all select ''xx'',''xx'',''xx'' union all select ''xx'',''xx'',''xx'&... 阅324 转0 评0 公众公开 15-09-08 11:05 |
<insert id="saveOrUpdate" ><selectKey keyProperty="count" resultType="int" order="BEFORE"> select count(*) from country where id = #{id} </selectKey> <if test="count >0"> update country set countryname = #{countryname},countrycode = #{country... 阅1380 转1 评0 公众公开 15-06-13 17:26 |
如何细粒度地控制你的MyBatis二级缓存(mybatis.MyBatis二级缓存的一个重要特点:即松散的Cache缓存管理和维护。当执行了"com.louis.mybatis.dao.DepartmentsMapper.updateByPrimaryKey"后,EmployeeMapper对应的缓存Cache结果被清空了,即"com.louis.mybatis.dao.DepartmentsMapper.updateByPrimaryKey"更新语句引起了Empl... 阅978 转3 评0 公众公开 15-06-10 23:36 |
mybatis自定义typeHandler映射对象为JSON技术背景: 一个domain对象不可避免的会出现List、Map类型的字段,或者将多个字段拼装到一个字段的情况。//存储hobbys private String hobbyExt; private String ext1; private String ext2; private String ext3; //存储ext1 、 ext2、 ext3 的信息 private String extInfo; public String getExtInfo(... 阅86 转0 评0 公众公开 15-06-09 09:33 |
MyBatis与Spring设置callSettersOnNulls项目中集成Mybatis与Spring,使用的是Mybatis3.2.7,以及Spring4.0.5,mybatis-spring-1.2.2;因为项目组成员想要偷懒,将数据从DB中查询出来时需要将字段映射为Map,而不想封装成Bean.看了 mybatis高级应用系列一:分页功能 这篇文章,发觉冤枉 MyBatis了,其实是 Mybatis-Spring挖下的坑, 校验的时候不走Mybat... 阅1808 转1 评0 公众公开 15-06-08 09:04 |