类 MybatisPlusInterceptor
- java.lang.Object
-
- com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor
-
- 所有已实现的接口:
org.apache.ibatis.plugin.Interceptor
@Signature(type=org.apache.ibatis.executor.statement.StatementHandler.class,method="prepare",args={java.sql.Connection.class,java.lang.Integer.class}) @Signature(type=org.apache.ibatis.executor.statement.StatementHandler.class,method="getBoundSql",args={}) @Signature(type=org.apache.ibatis.executor.Executor.class,method="update",args={org.apache.ibatis.mapping.MappedStatement.class,java.lang.Object.class}) @Signature(type=org.apache.ibatis.executor.Executor.class,method="query",args={org.apache.ibatis.mapping.MappedStatement.class,java.lang.Object.class,org.apache.ibatis.session.RowBounds.class,org.apache.ibatis.session.ResultHandler.class}) @Signature(type=org.apache.ibatis.executor.Executor.class,method="query",args={org.apache.ibatis.mapping.MappedStatement.class,java.lang.Object.class,org.apache.ibatis.session.RowBounds.class,org.apache.ibatis.session.ResultHandler.class,org.apache.ibatis.cache.CacheKey.class,org.apache.ibatis.mapping.BoundSql.class}) public class MybatisPlusInterceptor extends java.lang.Object implements org.apache.ibatis.plugin.Interceptor- 从以下版本开始:
- 3.4.0
- 作者:
- miemie
-
-
构造器概要
构造器 构造器 说明 MybatisPlusInterceptor()
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidaddInnerInterceptor(InnerInterceptor innerInterceptor)java.util.List<InnerInterceptor>getInterceptors()java.lang.Objectintercept(org.apache.ibatis.plugin.Invocation invocation)java.lang.Objectplugin(java.lang.Object target)voidsetInterceptors(java.util.List<InnerInterceptor> interceptors)voidsetProperties(java.util.Properties properties)使用内部规则,拿分页插件举个栗子:
-
-
-
方法详细资料
-
intercept
public java.lang.Object intercept(org.apache.ibatis.plugin.Invocation invocation) throws java.lang.Throwable- 指定者:
intercept在接口中org.apache.ibatis.plugin.Interceptor- 抛出:
java.lang.Throwable
-
plugin
public java.lang.Object plugin(java.lang.Object target)
- 指定者:
plugin在接口中org.apache.ibatis.plugin.Interceptor
-
addInnerInterceptor
public void addInnerInterceptor(InnerInterceptor innerInterceptor)
-
getInterceptors
public java.util.List<InnerInterceptor> getInterceptors()
-
setProperties
public void setProperties(java.util.Properties properties)
使用内部规则,拿分页插件举个栗子:- key: "@page" ,value: "com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor" - key: "page:limit" ,value: "100"
解读1: key 以 "@" 开头定义了这是一个需要组装的 `InnerInterceptor`, 以 "page" 结尾表示别名 value 是 `InnerInterceptor` 的具体的 class 全名 解读2: key 以上面定义的 "别名 + ':'" 开头指这个 `value` 是定义的该 `InnerInterceptor` 属性需要设置的值
如果这个 `InnerInterceptor` 不需要配置属性也要加别名
- 指定者:
setProperties在接口中org.apache.ibatis.plugin.Interceptor
-
setInterceptors
public void setInterceptors(java.util.List<InnerInterceptor> interceptors)
-
-