整合步骤
1. 准备工作 导入相关jar包
2. 编写配置文件,在src下添加一个 源文件夹 conf 存放配置文件
3. 编写类测试
包对应的模块:
controller---控制器
service--业务逻辑
dao ----数据层
entities ----实体类
map...
9年前 (2016-04-07) 1484℃ 0评论
3喜欢
一、配置基本的增删改查及结果集
直接在mapper接口方法名上使用注解
@Insert("insert into employee (username,salary,deptID) "
+ " values(#{username},#{salary},#{dept.id})")...
9年前 (2016-03-28) 1165℃ 0评论
1喜欢
使用mybatis实现分页
1.逻辑分页 ( 数据表加载到内存中分页 )
<!-- 使用逻辑分页
查询所有数据到内存
mybatis 使用RowBounds进行分页
-->
<select id="findEmps1" resultMap="empRes" &...
9年前 (2016-03-21) 2302℃ 2评论
3喜欢
mybatis中 使用 动态SQL:if / where /when/otherwise/trim 等条件配合使用,实现强大的动态SQL
定义一个结果集
<resultMap type="Employee" id="empRes">
<id property="...
9年前 (2016-03-16) 1539℃ 0评论
2喜欢
在mybatis mapper配置文件中使用 association 配置一对一关联,collection 配置一对多关联
创建测试的实体:
Employee ( id,username,salary,deptID(部门id 外键) ) ---对应 EmployeeMappe...
9年前 (2016-03-16) 1628℃ 0评论
4喜欢
MyBatis 本是apache的一个开源项目iBatis, 2010年这个项目由apache software foundation 迁移到了google code,并且改名为MyBatis 。2013年11月迁移到Github。
iBATIS一词来源于“internet”...
9年前 (2016-03-16) 1378℃ 0评论
3喜欢