use of com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor in project hippo4j by longtai-cn.
the class MybatisPlusConfig method mybatisPlusInterceptor.
@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 demo-SpringBoot by Max-Qiu.
the class MybatisPlusConfig method paginationInterceptor.
@Bean
public MybatisPlusInterceptor paginationInterceptor() {
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
// 添加分页插件
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
// 添加 攻击 SQL 阻断解析器,防止全表更新与删除
interceptor.addInnerInterceptor(new BlockAttackInnerInterceptor());
// 添加 乐观锁 插件
interceptor.addInnerInterceptor(new OptimisticLockerInnerInterceptor());
return interceptor;
}
use of com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor in project demo-SpringBoot by Max-Qiu.
the class MybatisPlusConfig method mybatisPlusInterceptor.
/**
* 插件配置
*/
@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor() {
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
// 添加分页插件
PaginationInnerInterceptor paginationInnerInterceptor = new PaginationInnerInterceptor();
// 设置无数据自动返回首页
paginationInnerInterceptor.setOverflow(true);
interceptor.addInnerInterceptor(paginationInnerInterceptor);
return interceptor;
}
use of com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor in project muscle-and-fitness-server by johnnymillergh.
the class MyBatisPlusConfiguration method mybatisPlusInterceptor.
/**
* Mybatis plus interceptor mybatis plus interceptor.
*
* @param paginationInnerInterceptor the pagination inner interceptor
* @param blockAttackInnerInterceptor the block attack inner interceptor
* @return the mybatis plus interceptor
* @see <a href='https://baomidou.com/guide/interceptor.html'>MybatisPlusInterceptor</a>
*/
@Bean
@Order(1)
public Interceptor mybatisPlusInterceptor(PaginationInnerInterceptor paginationInnerInterceptor, BlockAttackInnerInterceptor blockAttackInnerInterceptor) {
log.warn("Initial bean: '{}'", MybatisPlusInterceptor.class.getSimpleName());
val mybatisPlusInterceptor = new MybatisPlusInterceptor();
mybatisPlusInterceptor.addInnerInterceptor(paginationInnerInterceptor);
mybatisPlusInterceptor.addInnerInterceptor(blockAttackInnerInterceptor);
return mybatisPlusInterceptor;
}
use of com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor in project weather-push by yangh124.
the class MybatisPlusConfig method mybatisPlusInterceptor.
/**
* 分页插件
*/
@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor() {
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
return interceptor;
}
Aggregations