接口 InnerInterceptor

所有已知实现类:
DynamicTableNameInnerInterceptor, OptimisticLockerInnerInterceptor, ReplacePlaceholderInnerInterceptor

public interface InnerInterceptor
从以下版本开始:
3.4.0
作者:
miemie
  • 方法概要

    修饰符和类型
    方法
    说明
    default void
    beforeGetBoundSql(org.apache.ibatis.executor.statement.StatementHandler sh)
    StatementHandler.getBoundSql() 操作前置处理
    default void
    beforePrepare(org.apache.ibatis.executor.statement.StatementHandler sh, Connection connection, Integer transactionTimeout)
    StatementHandler.prepare(Connection, Integer) 操作前置处理
    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)
    Executor.query(MappedStatement, Object, RowBounds, ResultHandler, CacheKey, BoundSql) 操作前置处理
    default void
    beforeUpdate(org.apache.ibatis.executor.Executor executor, org.apache.ibatis.mapping.MappedStatement ms, Object parameter)
    Executor.update(MappedStatement, Object) 操作前置处理
    default void
     
    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)
    判断是否执行 Executor.query(MappedStatement, Object, RowBounds, ResultHandler, CacheKey, BoundSql)
    default boolean
    willDoUpdate(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 - MappedStatement
      parameter - parameter
      rowBounds - rowBounds
      resultHandler - resultHandler
      boundSql - 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 - MappedStatement
      parameter - parameter
      rowBounds - rowBounds
      resultHandler - resultHandler
      boundSql - 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 - MappedStatement
      parameter - 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 - MappedStatement
      parameter - 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 - Connection
      transactionTimeout - transactionTimeout
    • beforeGetBoundSql

      default void beforeGetBoundSql(org.apache.ibatis.executor.statement.StatementHandler sh)
      StatementHandler.getBoundSql() 操作前置处理

      只有 BatchExecutorReuseExecutor 才会调用到这个方法

      参数:
      sh - StatementHandler(可能是代理对象)
    • setProperties

      default void setProperties(Properties properties)