接口 InnerInterceptor

    • 方法概要

      所有方法 实例方法 默认方法 
      修饰符和类型 方法 说明
      default void beforeGetBoundSql​(org.apache.ibatis.executor.statement.StatementHandler sh)
      StatementHandler.getBoundSql() 操作前置处理
      default void beforePrepare​(org.apache.ibatis.executor.statement.StatementHandler sh, java.sql.Connection connection, java.lang.Integer transactionTimeout)
      StatementHandler.prepare(Connection, Integer) 操作前置处理
      default void beforeQuery​(org.apache.ibatis.executor.Executor executor, org.apache.ibatis.mapping.MappedStatement ms, java.lang.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, java.lang.Object parameter)
      Executor.update(MappedStatement, Object) 操作前置处理
      default void setProperties​(java.util.Properties properties)  
      default boolean willDoQuery​(org.apache.ibatis.executor.Executor executor, org.apache.ibatis.mapping.MappedStatement ms, java.lang.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, java.lang.Object parameter)
      判断是否执行 Executor.update(MappedStatement, Object)
    • 方法详细资料

      • willDoQuery

        default boolean willDoQuery​(org.apache.ibatis.executor.Executor executor,
                                    org.apache.ibatis.mapping.MappedStatement ms,
                                    java.lang.Object parameter,
                                    org.apache.ibatis.session.RowBounds rowBounds,
                                    org.apache.ibatis.session.ResultHandler resultHandler,
                                    org.apache.ibatis.mapping.BoundSql boundSql)
                             throws java.sql.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
        抛出:
        java.sql.SQLException
      • beforeQuery

        default void beforeQuery​(org.apache.ibatis.executor.Executor executor,
                                 org.apache.ibatis.mapping.MappedStatement ms,
                                 java.lang.Object parameter,
                                 org.apache.ibatis.session.RowBounds rowBounds,
                                 org.apache.ibatis.session.ResultHandler resultHandler,
                                 org.apache.ibatis.mapping.BoundSql boundSql)
                          throws java.sql.SQLException
        Executor.query(MappedStatement, Object, RowBounds, ResultHandler, CacheKey, BoundSql) 操作前置处理

        改改sql啥的

        参数:
        executor - Executor(可能是代理对象)
        ms - MappedStatement
        parameter - parameter
        rowBounds - rowBounds
        resultHandler - resultHandler
        boundSql - boundSql
        抛出:
        java.sql.SQLException
      • willDoUpdate

        default boolean willDoUpdate​(org.apache.ibatis.executor.Executor executor,
                                     org.apache.ibatis.mapping.MappedStatement ms,
                                     java.lang.Object parameter)
                              throws java.sql.SQLException
        判断是否执行 Executor.update(MappedStatement, Object)

        如果不执行update操作,则影响行数的值为 -1

        参数:
        executor - Executor(可能是代理对象)
        ms - MappedStatement
        parameter - parameter
        抛出:
        java.sql.SQLException
      • beforeUpdate

        default void beforeUpdate​(org.apache.ibatis.executor.Executor executor,
                                  org.apache.ibatis.mapping.MappedStatement ms,
                                  java.lang.Object parameter)
                           throws java.sql.SQLException
        Executor.update(MappedStatement, Object) 操作前置处理

        改改sql啥的

        参数:
        executor - Executor(可能是代理对象)
        ms - MappedStatement
        parameter - parameter
        抛出:
        java.sql.SQLException
      • beforePrepare

        default void beforePrepare​(org.apache.ibatis.executor.statement.StatementHandler sh,
                                   java.sql.Connection connection,
                                   java.lang.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​(java.util.Properties properties)