use of com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor in project ddd-framework by ken-xue.
the class InfrastructureConfig method mybatisPlusInterceptor.
/**
* mbp分页
* @return
*/
@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor() {
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
return interceptor;
}
use of com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor in project onex-boot by zhangchaoxu.
the class MybatisPlusConfig method mybatisPlusInterceptor.
/**
* 配置分页
* 新的分页插件,一缓和二缓遵循mybatis的规则
* 需要设置 MybatisConfiguration#useDeprecatedExecutor = false 避免缓存出现问题
* see {https://mybatis.plus/guide/page.html}
*
* @return PaginationInterceptor
*/
@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor() {
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
// 乐观锁插件
// interceptor.addInnerInterceptor(new OptimisticLockerInnerInterceptor());
// 动态表名拦截器
// interceptor.addInnerInterceptor(initDynamicTableNameInnerInterceptor());
// 分页拦截器
interceptor.addInnerInterceptor(initPaginationInterceptor());
return interceptor;
}
use of com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor in project XHuiCloud by sindaZeng.
the class XHuiMybatisPlusConfig method mybatisPlusInterceptor.
/**
* 数据处理
*/
/**
* mybatis plus 拦截器配置
* @return
*/
@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor(XHuiTenantHandler xHuiTenantHandler) {
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
// 多租户支持
TenantLineInnerInterceptor tenantLineInnerInterceptor = new TenantLineInnerInterceptor();
tenantLineInnerInterceptor.setTenantLineHandler(xHuiTenantHandler);
interceptor.addInnerInterceptor(tenantLineInnerInterceptor);
interceptor.addInnerInterceptor(new PaginationInnerInterceptor());
return interceptor;
}
use of com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor in project ebase-boot by ebase-projects.
the class CustomMybatisPlusConfig method mybatisPlusInterceptor.
/**
* 新MybatisPlus插件配置
*/
@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor(ObjectProvider<QueryInterceptor[]> queryInterceptors) {
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
// 配置分页拦截器
CustomPaginationInterceptor paginationInterceptor = new CustomPaginationInterceptor();
// 配置自定义查询拦截器
QueryInterceptor[] queryInterceptorArray = queryInterceptors.getIfAvailable();
if (ObjectUtil.isNotEmpty(queryInterceptorArray)) {
AnnotationAwareOrderComparator.sort(queryInterceptorArray);
paginationInterceptor.setQueryInterceptors(queryInterceptorArray);
}
// 新分页
interceptor.addInnerInterceptor(paginationInterceptor);
return interceptor;
}
use of com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor in project shopzz by whoiszxl.
the class MyBatisConfig method mybatisPlusInterceptor.
/**
* 新的分页插件,一缓和二缓遵循mybatis的规则,需要设置 MybatisConfiguration#useDeprecatedExecutor = false 避免缓存出现问题
*/
@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor() {
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
return interceptor;
}
Aggregations