阅读mybatis插件文档

This commit is contained in:
asahi
2024-05-25 02:27:45 +08:00
parent 828d865ca8
commit 0b72fb58f1
2 changed files with 10 additions and 0 deletions

1
mybatis/mybatis-plus.md Normal file
View File

@@ -0,0 +1 @@
# Mybatis Plus

View File

@@ -53,6 +53,7 @@
- [通过Configuration来创建SqlSessionFactory](#通过configuration来创建sqlsessionfactory) - [通过Configuration来创建SqlSessionFactory](#通过configuration来创建sqlsessionfactory)
- [SqlSessionFactory构建SqlSession实例](#sqlsessionfactory构建sqlsession实例) - [SqlSessionFactory构建SqlSession实例](#sqlsessionfactory构建sqlsession实例)
- [openSession参数](#opensession参数) - [openSession参数](#opensession参数)
- [插件](#插件)
# mybatis框架 # mybatis框架
## Mybatis中主要的类及其生命周期 ## Mybatis中主要的类及其生命周期
@@ -1078,3 +1079,11 @@ SqlSession openSession(ExecutorType execType, Connection connection)
> batch会将相关的sql语句分组到一个batch文件中并且一次提交到database server端。 > batch会将相关的sql语句分组到一个batch文件中并且一次提交到database server端。
> - addBatch方法会将单独的sql语句添加到batch中而executeBatch方法会执行batch中所有被分组到一起的sql语句 > - addBatch方法会将单独的sql语句添加到batch中而executeBatch方法会执行batch中所有被分组到一起的sql语句
> executeBatch方法会返回一个Integer数组数组中每一个元素代表每个update语句的update count > executeBatch方法会返回一个Integer数组数组中每一个元素代表每个update语句的update count
## 插件
mybatis允许通过interceptor对mapped statement的执行进行拦截mybatis支持拦截如下调用
- Executor(update, query, flushStatements, commit, rollback, getTransaction, close, isClosed)
- ParameterHandler (getParameterObject, setParameters)
- ResultSetHandler (handleResultSets, handleOutputParameters)
- StatementHandler (prepare, parameterize, batch, update, query)