Search in sources :

Example 1 with MybatisPlusInterceptor

use of com.baomidou.mybatisplus.solon.plugins.MybatisPlusInterceptor in project solon by noear.

the class Config method plusInterceptor.

@Bean
public Interceptor plusInterceptor() {
    MybatisPlusInterceptor plusInterceptor = new MybatisPlusInterceptor();
    plusInterceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
    return plusInterceptor;
}
Also used : MybatisPlusInterceptor(com.baomidou.mybatisplus.solon.plugins.MybatisPlusInterceptor) PaginationInnerInterceptor(com.baomidou.mybatisplus.solon.plugins.inner.PaginationInnerInterceptor) Bean(org.noear.solon.annotation.Bean)

Example 2 with MybatisPlusInterceptor

use of com.baomidou.mybatisplus.solon.plugins.MybatisPlusInterceptor in project solon-examples by noear.

the class Config method db1_interceptor.

@Bean
public void db1_interceptor(@Db("db1") org.apache.ibatis.session.Configuration cfg) {
    MybatisPlusInterceptor plusInterceptor = new MybatisPlusInterceptor();
    plusInterceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
    cfg.setCacheEnabled(false);
    cfg.addInterceptor(plusInterceptor);
}
Also used : MybatisPlusInterceptor(com.baomidou.mybatisplus.solon.plugins.MybatisPlusInterceptor) PaginationInnerInterceptor(com.baomidou.mybatisplus.solon.plugins.inner.PaginationInnerInterceptor) Bean(org.noear.solon.annotation.Bean)

Aggregations

MybatisPlusInterceptor (com.baomidou.mybatisplus.solon.plugins.MybatisPlusInterceptor)2 PaginationInnerInterceptor (com.baomidou.mybatisplus.solon.plugins.inner.PaginationInnerInterceptor)2 Bean (org.noear.solon.annotation.Bean)2