目录
什么是 MyBatis?............................................................................................................. 5
入门................................................................................................................................. 5
从 XML 中构建 SqlSessionFactory .............................................................................. 5
不使用 XML 构建 SqlSessionFactory........................................................................... 6
从 SqlSessionFactory 中获取 SqlSession....................................................................... 6
探究已映射的 SQL 语句 ............................................................................................ 7
命名空间的一点注释 .......................................................................................... 8
范围和生命周期 ........................................................................................................ 8
SqlSessionFactoryBuilder ..................................................................................... 8
SqlSessionFactory................................................................................................ 9
SqlSession .......................................................................................................... 9
Mapper 实例 ....................................................................................................... 9
XML 映射配置文件 ........................................................................................................ 10
properties................................................................................................................. 10
Settings ....................................................................................................................11
typeAliases .............................................................................................................. 12
typeHandlers ............................................................................................................ 13
objectFactory ........................................................................................................... 14
plugins .................................................................................................................... 15
environments............................................................................................................ 16
transactionManager ............................................................................................ 17
dataSsource....................................................................................................... 17
mappers ................................................................................................................... 19
SQL 映射的 XML 文件 ................................................................................................... 19
select....................................................................................................................... 20
insert,update,delete .............................................................................................. 21
sql........................................................................................................................... 23
Parameters ............................................................................................................... 24
resultMap ................................................................................................................ 25
高级结果映射................................................................................................... 27
id,result.......................................................................................................... 29
支持的 JDBC 类型 ............................................................................................ 30
构造方法.......................................................................................................... 30
关联................................................................................................................. 31
集合................................................................................................................. 34
鉴别器 ............................................................................................................. 36
缓存........................................................................................................................ 38
使用自定义缓存 ............................................................................................... 38
参照缓存................................................................................................................. 39
动态 SQL ................................................................................................................ 39
if ..................................................................................................................... 40
choose, when, otherwise ..................................................................................... 40