Codota Logo
MybatisSqlSessionFactoryBean.setPlugins
Code IndexAdd Codota to your IDE (free)

How to use
setPlugins
method
in
com.baomidou.mybatisplus.spring.MybatisSqlSessionFactoryBean

Best Java code snippets using com.baomidou.mybatisplus.spring.MybatisSqlSessionFactoryBean.setPlugins (Showing top 6 results out of 315)

  • Common ways to obtain MybatisSqlSessionFactoryBean
private void myMethod () {
MybatisSqlSessionFactoryBean m =
  • Codota Iconnew MybatisSqlSessionFactoryBean()
  • Smart code suggestions by Codota
}
origin: 5-Ason/ason-spring-cloud

@Bean(name = "basisSqlSessionFactory")
public SqlSessionFactory sqlSessionFactory(@Qualifier(value = "basisGlobalConfig")GlobalConfiguration globalConfig,
                      @Qualifier(value = "basisDataSource")DruidDataSource dataSource) throws Exception {
  log.info("初始化SqlSessionFactory");
  String mapperLocations = "classpath:db-ason/sql/**/*.xml";
  String configLocation = "classpath:db-ason/mybatis/mybatis-sqlconfig.xml";
  String typeAliasesPackage = "com.ason.entity.**";
  MybatisSqlSessionFactoryBean sqlSessionFactory = new MybatisSqlSessionFactoryBean();
  // 数据源
  sqlSessionFactory.setDataSource(dataSource);
  // 全局配置
  sqlSessionFactory.setGlobalConfig(globalConfig);
  Interceptor[] interceptor = {new PaginationInterceptor()};
  // 分页插件
  sqlSessionFactory.setPlugins(interceptor);
  ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
  try {
    // 自动扫描Mapping.xml文件
    sqlSessionFactory.setMapperLocations(resolver.getResources(mapperLocations));
    sqlSessionFactory.setConfigLocation(resolver.getResource(configLocation));
    sqlSessionFactory.setTypeAliasesPackage(typeAliasesPackage);
    return sqlSessionFactory.getObject();
  } catch (Exception e) {
    e.printStackTrace();
    throw e;
  }
}
origin: liupeng328/java-api-doc

@Bean("mybatisSqlSession")
public SqlSessionFactory sqlSessionFactory(DataSource dataSource, ResourceLoader resourceLoader, GlobalConfiguration globalConfiguration) throws Exception {
  MybatisSqlSessionFactoryBean sqlSessionFactory = new MybatisSqlSessionFactoryBean();
  sqlSessionFactory.setDataSource(dataSource);
  MybatisConfiguration configuration = new MybatisConfiguration();
  configuration.setDefaultScriptingLanguage(MybatisXMLLanguageDriver.class);
  configuration.setJdbcTypeForNull(JdbcType.NULL);
  sqlSessionFactory.setConfiguration(configuration);
  sqlSessionFactory.setPlugins(new Interceptor[]{
      new PaginationInterceptor(),
      new PerformanceInterceptor(),
      new OptimisticLockerInterceptor()
  });
  sqlSessionFactory.setGlobalConfig(globalConfiguration);
  return sqlSessionFactory.getObject();
}
origin: com.baomidou/mybatisplus-spring-boot-starter

factory.setPlugins(this.interceptors);
origin: imhuzi/mybatis-plus-sharding-jdbc-spring-boot-starter

factory.setPlugins(this.interceptors);
origin: MIYAOW/MI-S

mybatisPlus.setPlugins(this.interceptors);
origin: watchdog-framework/watchdog-framework

mybatisPlus.setPlugins(this.interceptors);
com.baomidou.mybatisplus.springMybatisSqlSessionFactoryBeansetPlugins

Popular methods of MybatisSqlSessionFactoryBean

  • <init>
  • setDataSource
  • setGlobalConfig
  • setConfigLocation
  • setMapperLocations
  • setTypeAliasesPackage
  • getObject
  • setConfiguration
  • setDatabaseIdProvider
  • setTypeHandlersPackage
  • setVfs
  • setConfigurationProperties
  • setVfs,
  • setConfigurationProperties,
  • setTypeEnumsPackage

Popular in Java

  • Finding current android device location
  • setContentView (Activity)
  • getExternalFilesDir (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • JTable (javax.swing)
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now