- All Superinterfaces:
org.miaixz.bus.core.Handler<T>
public interface MapperHandler<T>
extends org.miaixz.bus.core.Handler<T>
SQL 拦截处理器
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidgetBoundSql(org.apache.ibatis.executor.statement.StatementHandler statementHandler) 在 StatementHandler 的 getBoundSql 方法执行前的预处理 仅在 BatchExecutor 和 ReuseExecutor 中调用 可用于修改绑定的 SQLdefault booleanisQuery(org.apache.ibatis.executor.Executor executor, org.apache.ibatis.mapping.MappedStatement mappedStatement, Object parameter, org.apache.ibatis.session.RowBounds rowBounds, org.apache.ibatis.session.ResultHandler resultHandler, org.apache.ibatis.mapping.BoundSql boundSql) 判断是否执行 Executor 的 query 方法 如果返回 false,则不执行查询操作,直接返回空列表default booleanisUpdate(org.apache.ibatis.executor.Executor executor, org.apache.ibatis.mapping.MappedStatement mappedStatement, Object parameter) 判断是否执行 Executor 的 update 方法 如果返回 false,则 update 操作不执行,影响行数返回 -1default voidprepare(org.apache.ibatis.executor.statement.StatementHandler statementHandler) 在 StatementHandler 的 prepare 方法执行前的预处理 可用于修改 SQL 或连接配置default voidquery(Object result, org.apache.ibatis.executor.Executor executor, org.apache.ibatis.mapping.MappedStatement mappedStatement, Object parameter, org.apache.ibatis.session.RowBounds rowBounds, org.apache.ibatis.session.ResultHandler resultHandler, org.apache.ibatis.mapping.BoundSql boundSql) 在 Executor 的 query 方法执行前的预处理 可用于修改 SQL、参数或记录日志default voidupdate(org.apache.ibatis.executor.Executor executor, org.apache.ibatis.mapping.MappedStatement mappedStatement, Object parameter) 在 Executor 的 update 方法执行前的预处理 可用于修改 SQL 或参数Methods inherited from interface org.miaixz.bus.core.Handler
after, before, setProperties
-
Method Details
-
prepare
default void prepare(org.apache.ibatis.executor.statement.StatementHandler statementHandler) 在 StatementHandler 的 prepare 方法执行前的预处理 可用于修改 SQL 或连接配置- Parameters:
statementHandler- 语句处理器,可能为代理对象
-
isUpdate
default boolean isUpdate(org.apache.ibatis.executor.Executor executor, org.apache.ibatis.mapping.MappedStatement mappedStatement, Object parameter) 判断是否执行 Executor 的 update 方法 如果返回 false,则 update 操作不执行,影响行数返回 -1- Parameters:
executor- MyBatis 执行器,可能为代理对象mappedStatement- 映射语句,包含 SQL 配置parameter- 更新参数- Returns:
- 返回 true 表示继续执行更新,返回 false 表示终止更新
-
update
default void update(org.apache.ibatis.executor.Executor executor, org.apache.ibatis.mapping.MappedStatement mappedStatement, Object parameter) 在 Executor 的 update 方法执行前的预处理 可用于修改 SQL 或参数- Parameters:
executor- MyBatis 执行器,可能为代理对象mappedStatement- 映射语句,包含 SQL 配置parameter- 更新参数
-
isQuery
default boolean isQuery(org.apache.ibatis.executor.Executor executor, org.apache.ibatis.mapping.MappedStatement mappedStatement, Object parameter, org.apache.ibatis.session.RowBounds rowBounds, org.apache.ibatis.session.ResultHandler resultHandler, org.apache.ibatis.mapping.BoundSql boundSql) 判断是否执行 Executor 的 query 方法 如果返回 false,则不执行查询操作,直接返回空列表- Parameters:
executor- MyBatis 执行器,可能为代理对象mappedStatement- 映射语句,包含 SQL 配置parameter- 查询参数rowBounds- 分页参数resultHandler- 结果处理器boundSql- 绑定的 SQL 对象- Returns:
- 返回 true 表示继续执行查询,返回 false 表示终止查询
-
query
default void query(Object result, org.apache.ibatis.executor.Executor executor, org.apache.ibatis.mapping.MappedStatement mappedStatement, Object parameter, org.apache.ibatis.session.RowBounds rowBounds, org.apache.ibatis.session.ResultHandler resultHandler, org.apache.ibatis.mapping.BoundSql boundSql) 在 Executor 的 query 方法执行前的预处理 可用于修改 SQL、参数或记录日志- Parameters:
executor- MyBatis 执行器,可能为代理对象mappedStatement- 映射语句,包含 SQL 配置parameter- 查询参数rowBounds- 分页参数resultHandler- 结果处理器boundSql- 绑定的 SQL 对象
-
getBoundSql
default void getBoundSql(org.apache.ibatis.executor.statement.StatementHandler statementHandler) 在 StatementHandler 的 getBoundSql 方法执行前的预处理 仅在 BatchExecutor 和 ReuseExecutor 中调用 可用于修改绑定的 SQL- Parameters:
statementHandler- 语句处理器,可能为代理对象
-