Codota Logo
MybatisSqlSessionFactoryBean.<init>
Code IndexAdd Codota to your IDE (free)

How to use
com.baomidou.mybatisplus.spring.MybatisSqlSessionFactoryBean
constructor

Best Java code snippets using com.baomidou.mybatisplus.spring.MybatisSqlSessionFactoryBean.<init> (Showing top 8 results out of 315)

  • Common ways to obtain MybatisSqlSessionFactoryBean
private void myMethod () {
MybatisSqlSessionFactoryBean m =
  • Codota Iconnew MybatisSqlSessionFactoryBean()
  • Smart code suggestions by Codota
}
origin: yujunhao8831/spring-boot-mybatisplus-multiple-datasource

@Bean
@Primary
public MybatisSqlSessionFactoryBean mybatisSqlSessionFactoryBean ( DynamicMultipleDataSource dynamicMultipleDataSource ) {
  MybatisSqlSessionFactoryBean sqlSessionFactoryBean = new MybatisSqlSessionFactoryBean();
  sqlSessionFactoryBean.setDataSource( dynamicMultipleDataSource );
  return sqlSessionFactoryBean;
}
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: huangjian888/jeeweb-mybatis-springboot

MybatisSqlSessionFactoryBean sessionFactory = new MybatisSqlSessionFactoryBean();
sessionFactory.setDataSource(dataSource);
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

@Bean
@ConditionalOnMissingBean
public SqlSessionFactory sqlSessionFactory(DataSource dataSource) throws Exception {
  MybatisSqlSessionFactoryBean factory = new MybatisSqlSessionFactoryBean();
  factory.setDataSource(dataSource);
  factory.setVfs(SpringBootVFS.class);
origin: imhuzi/mybatis-plus-sharding-jdbc-spring-boot-starter

@Bean
@ConditionalOnMissingBean
public SqlSessionFactory sqlSessionFactory(DataSource dataSource) throws Exception {
  MybatisSqlSessionFactoryBean factory = new MybatisSqlSessionFactoryBean();
  try {
    factory.setDataSource(dataSource);
origin: MIYAOW/MI-S

@ConditionalOnMissingBean
public MybatisSqlSessionFactoryBean mybatisSqlSessionFactoryBean() {
  MybatisSqlSessionFactoryBean mybatisPlus = new MybatisSqlSessionFactoryBean();
  mybatisPlus.setDataSource(dataSource);
  mybatisPlus.setVfs(SpringBootVFS.class);
origin: watchdog-framework/watchdog-framework

MybatisSqlSessionFactoryBean mybatisPlus = new MybatisSqlSessionFactoryBean();
mybatisPlus.setDataSource(dataSource);
mybatisPlus.setVfs(SpringBootVFS.class);
com.baomidou.mybatisplus.springMybatisSqlSessionFactoryBean<init>

Popular methods of MybatisSqlSessionFactoryBean

  • setDataSource
  • setGlobalConfig
  • setConfigLocation
  • setMapperLocations
  • setPlugins
  • setTypeAliasesPackage
  • getObject
  • setConfiguration
  • setDatabaseIdProvider
  • setTypeHandlersPackage
  • setVfs
  • setConfigurationProperties
  • setVfs,
  • setConfigurationProperties,
  • setTypeEnumsPackage

Popular in Java

  • Finding current android device location
  • putExtra (Intent)
  • onRequestPermissionsResult (Fragment)
  • getContentResolver (Context)
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
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