
mybatis
文章平均质量分 81
Guo
吃的苦中苦,方位人上人!
展开
-
MyBatis批量添加
在程序中封装了一个List集合对象,然后需要把该集合中的实体插入到数据库中,由于项目使用了Spring+MyBatis的配置,所以打算使用MyBatis批量插入,由于之前没用过批量插入,在网上找了一些资料后最终实现了,把详细过程贴出来。 实体类TrainRecord结构如下: Java代码 public class TrainRecord implements转载 2014-04-29 13:40:24 · 1709 阅读 · 0 评论 -
generator自动生成mybatis的xml配置、model、map
generator自动生成mybatis的xml配置、model、map等信息: 1、下载mybatis-generator-core-1.3.2.jar包,解压 找到lib下的需要jar包。 2、编写genertor的xml文件,名下:generator.xml Xml代码 xml version="1.0" encoding="UTF-8"?>转载 2014-04-17 10:29:40 · 2693 阅读 · 0 评论 -
MyBatis的动态SQL
基础部分可以查看我的另一篇博客:http://haohaoxuexi.iteye.com/blog/1333271 MyBatis的动态SQL是基于OGNL表达式的,它可以帮助我们方便的在SQL语句中实现某些逻辑。 MyBatis中用于实现动态SQL的元素主要有: if choose(when,otherwise) trim where s转载 2014-04-28 11:45:30 · 842 阅读 · 0 评论 -
mybatis集成spring的事务管理
第一 创建一个测试实体 Java代码 收藏代码 public class Order { private int id; private String orderName; public Order(String orderName) { this.orderName = orderName; }转载 2014-04-28 21:23:27 · 588 阅读 · 0 评论 -
mybatis sql in 查询
mybatis官方学习文档:http://www.mybatis.org/core/getting-started.html 本文转自:http://www.blogjava.net/xmatthew/archive/2011/08/31/355879.html 1. 当查询的参数只有一个时 findByIds(List ids) 1.1 如果参数的类型是List, 则在使用翻译 2014-04-28 21:25:16 · 508 阅读 · 0 评论