接口 InnerInterceptor
- 所有已知实现类:
BaseMultiTableInnerInterceptor,BlockAttackInnerInterceptor,DataChangeRecorderInnerInterceptor,DataPermissionInterceptor,DynamicTableNameInnerInterceptor,IllegalSQLInnerInterceptor,OptimisticLockerInnerInterceptor,PaginationInnerInterceptor,ReplacePlaceholderInnerInterceptor,TenantLineInnerInterceptor
public interface InnerInterceptor
- 从以下版本开始:
- 3.4.0
- 作者:
- miemie
-
方法概要
修饰符和类型方法说明default voidbeforeGetBoundSql(org.apache.ibatis.executor.statement.StatementHandler sh) StatementHandler.getBoundSql()操作前置处理default voidbeforePrepare(org.apache.ibatis.executor.statement.StatementHandler sh, Connection connection, Integer transactionTimeout) StatementHandler.prepare(Connection, Integer)操作前置处理default voidbeforeQuery(org.apache.ibatis.executor.Executor executor, org.apache.ibatis.mapping.MappedStatement ms, Object parameter, org.apache.ibatis.session.RowBounds rowBounds, org.apache.ibatis.session.ResultHandler resultHandler, org.apache.ibatis.mapping.BoundSql boundSql) Executor.query(MappedStatement, Object, RowBounds, ResultHandler, CacheKey, BoundSql)操作前置处理default voidbeforeUpdate(org.apache.ibatis.executor.Executor executor, org.apache.ibatis.mapping.MappedStatement ms, Object parameter) Executor.update(MappedStatement, Object)操作前置处理default voidsetProperties(Properties properties) default booleanwillDoQuery(org.apache.ibatis.executor.Executor executor, org.apache.ibatis.mapping.MappedStatement ms, Object parameter, org.apache.ibatis.session.RowBounds rowBounds, org.apache.ibatis.session.ResultHandler resultHandler, org.apache.ibatis.mapping.BoundSql boundSql) 判断是否执行Executor.query(MappedStatement, Object, RowBounds, ResultHandler, CacheKey, BoundSql)default booleanwillDoUpdate(org.apache.ibatis.executor.Executor executor, org.apache.ibatis.mapping.MappedStatement ms, Object parameter) 判断是否执行Executor.update(MappedStatement, Object)
-
方法详细资料
-
willDoQuery
default boolean willDoQuery(org.apache.ibatis.executor.Executor executor, org.apache.ibatis.mapping.MappedStatement ms, Object parameter, org.apache.ibatis.session.RowBounds rowBounds, org.apache.ibatis.session.ResultHandler resultHandler, org.apache.ibatis.mapping.BoundSql boundSql) throws SQLException 判断是否执行Executor.query(MappedStatement, Object, RowBounds, ResultHandler, CacheKey, BoundSql)如果不执行query操作,则返回
Collections.emptyList()- 参数:
executor- Executor(可能是代理对象)ms- MappedStatementparameter- parameterrowBounds- rowBoundsresultHandler- resultHandlerboundSql- boundSql- 返回:
- 新的 boundSql
- 抛出:
SQLException
-
beforeQuery
default void beforeQuery(org.apache.ibatis.executor.Executor executor, org.apache.ibatis.mapping.MappedStatement ms, Object parameter, org.apache.ibatis.session.RowBounds rowBounds, org.apache.ibatis.session.ResultHandler resultHandler, org.apache.ibatis.mapping.BoundSql boundSql) throws SQLException Executor.query(MappedStatement, Object, RowBounds, ResultHandler, CacheKey, BoundSql)操作前置处理改改sql啥的
- 参数:
executor- Executor(可能是代理对象)ms- MappedStatementparameter- parameterrowBounds- rowBoundsresultHandler- resultHandlerboundSql- boundSql- 抛出:
SQLException
-
willDoUpdate
default boolean willDoUpdate(org.apache.ibatis.executor.Executor executor, org.apache.ibatis.mapping.MappedStatement ms, Object parameter) throws SQLException 判断是否执行Executor.update(MappedStatement, Object)如果不执行update操作,则影响行数的值为 -1
- 参数:
executor- Executor(可能是代理对象)ms- MappedStatementparameter- parameter- 抛出:
SQLException
-
beforeUpdate
default void beforeUpdate(org.apache.ibatis.executor.Executor executor, org.apache.ibatis.mapping.MappedStatement ms, Object parameter) throws SQLException Executor.update(MappedStatement, Object)操作前置处理改改sql啥的
- 参数:
executor- Executor(可能是代理对象)ms- MappedStatementparameter- parameter- 抛出:
SQLException
-
beforePrepare
default void beforePrepare(org.apache.ibatis.executor.statement.StatementHandler sh, Connection connection, Integer transactionTimeout) StatementHandler.prepare(Connection, Integer)操作前置处理改改sql啥的
- 参数:
sh- StatementHandler(可能是代理对象)connection- ConnectiontransactionTimeout- transactionTimeout
-
beforeGetBoundSql
default void beforeGetBoundSql(org.apache.ibatis.executor.statement.StatementHandler sh) StatementHandler.getBoundSql()操作前置处理只有
BatchExecutor和ReuseExecutor才会调用到这个方法- 参数:
sh- StatementHandler(可能是代理对象)
-
setProperties
-