use of com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor in project ox-data-cloud by ox-data.
the class MybatisConfig method mybatisPlusInterceptor.
/**
* 新的分页插件,一缓和二缓遵循mybatis的规则,需要设置 MybatisConfiguration#useDeprecatedExecutor = false 避免缓存出现问题(该属性会在旧插件移除后一同移除)
*/
private MybatisPlusInterceptor mybatisPlusInterceptor() {
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
DataPermissionInterceptor dataPermissionInterceptor = new DataPermissionInterceptor();
dataPermissionInterceptor.setDataPermissionHandler(new CustomDataPermissionHandler());
interceptor.addInnerInterceptor(dataPermissionInterceptor);
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
interceptor.addInnerInterceptor(new OptimisticLockerInnerInterceptor());
return interceptor;
}
use of com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor in project springboot by ipcrystal.
the class MybatisPlusConfig method mybatisPlusInterceptor.
/**
* Mybatis plus interceptor mybatis plus interceptor.
*
* @return the mybatis plus interceptor
*/
@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor() {
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
return interceptor;
}
use of com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor in project ballcat by ballcat-projects.
the class MybatisPlusConfig method mybatisPlusInterceptor.
/**
* MybatisPlusInterceptor 插件,默认提供分页插件</br>
* 如需其他MP内置插件,则需自定义该Bean
* @return MybatisPlusInterceptor
*/
@Bean
@ConditionalOnMissingBean(MybatisPlusInterceptor.class)
public MybatisPlusInterceptor mybatisPlusInterceptor() {
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
return interceptor;
}
use of com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor in project olive by ClareTung.
the class MyBatisConfig method mybatisPlusInterceptor.
/**
* 注册分页插件
*
* @return
*/
@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.inner.PaginationInnerInterceptor in project lilishop by lilishop.
the class MybatisPlusConfig method mybatisPlusInterceptor.
/**
* 分页插件,自动识别数据库类型
*/
@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor() {
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
return interceptor;
// 阻断解析器,测试环境使用
// PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
//
// List<ISqlParser> sqlParserList = new ArrayList<>();
// //攻击 SQL 阻断解析器、加入解析链
// sqlParserList.add(new BlockAttackSqlParser());
// paginationInterceptor.setSqlParserList(sqlParserList);
// return paginationInterceptor;
}
Aggregations