use of com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor in project bubble-fireworks by fxbin.
the class MybatisPlusAutoConfiguration method mybatisPlusInterceptor.
@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor() {
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
// 分页插件
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
// 乐观锁插件
interceptor.addInnerInterceptor(new OptimisticLockerInnerInterceptor());
return interceptor;
}
use of com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor in project usercenteradmin by caijiya.
the class MybatisPlusConfig method mybatisPlusInterceptor.
@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor() {
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
PaginationInnerInterceptor paginationInnerInterceptor = new PaginationInnerInterceptor();
paginationInnerInterceptor.setDbType(DbType.MYSQL);
paginationInnerInterceptor.setOverflow(true);
interceptor.addInnerInterceptor(paginationInnerInterceptor);
return interceptor;
}
use of com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor in project matecloud by matevip.
the class MybatisPlusConfiguration method paginationInterceptor.
/**
* 新的分页插件,一缓和二缓遵循mybatis的规则,
* 需要设置 MybatisConfiguration#useDeprecatedExecutor = false
* 避免缓存出现问题(该属性会在旧插件移除后一同移除)
*/
@Bean
public MybatisPlusInterceptor paginationInterceptor() {
boolean enableTenant = tenantProperties.getEnable();
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
if (enableTenant) {
interceptor.addInnerInterceptor(tenantLineInnerInterceptor);
}
// 分页插件: PaginationInnerInterceptor
PaginationInnerInterceptor paginationInnerInterceptor = new PaginationInnerInterceptor();
paginationInnerInterceptor.setMaxLimit(MAX_LIMIT);
// 防止全表更新与删除插件: BlockAttackInnerInterceptor
// BlockAttackInnerInterceptor blockAttackInnerInterceptor = new BlockAttackInnerInterceptor();
interceptor.addInnerInterceptor(paginationInnerInterceptor);
// interceptor.addInnerInterceptor(blockAttackInnerInterceptor);
return interceptor;
}
use of com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor in project DJI-Cloud-API-Demo by dji-sdk.
the class MybatisPlusConfiguration method mybatisPlusInterceptor.
@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor() {
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
// select database
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
return interceptor;
}
use of com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor in project xuxiaowei-cloud by xuxiaowei-cloud.
the class MybatisPlusConfiguration method mybatisPlusInterceptor.
/**
* 新的分页插件、攻击 SQL 阻断解析器,防止全表更新与删除
* <p>
* 一缓和二缓遵循mybatis的规则
* <p>
* 需要设置 {@link MybatisConfiguration#setConfigurationFactory(Class)} = false 避免缓存出现问题(该属性会在旧插件移除后一同移除)
*/
@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor() {
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
// 分页拦截器
interceptor.addInnerInterceptor(new PaginationInnerInterceptor());
// 攻击 SQL 阻断解析器,防止全表更新与删除
interceptor.addInnerInterceptor(new BlockAttackInnerInterceptor());
return interceptor;
}
Aggregations