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

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

Best Java code snippets using com.baomidou.mybatisplus.spring.MybatisSqlSessionFactoryBean.setMapperLocations (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: huangjian888/jeeweb-mybatis-springboot

sessionFactory.setMapperLocations(resolver.getResources("classpath:/mappings/**/*.xml"));
sessionFactory.setTypeAliasesPackage("cn.jeeweb.modules.*.entity");
origin: watchdog-framework/watchdog-framework

mybatisPlus.setVfs(SpringBootVFS.class);
PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
mybatisPlus.setMapperLocations(resolver.getResources("classpath:mapper/*.xml"));
if (StringUtils.hasText(this.properties.getConfigLocation())) {
  mybatisPlus.setConfigLocation(this.resourceLoader.getResource(this.properties.getConfigLocation()));
  mybatisPlus.setMapperLocations(this.properties.resolveMapperLocations());
origin: com.baomidou/mybatisplus-spring-boot-starter

factory.setMapperLocations(this.properties.resolveMapperLocations());
origin: imhuzi/mybatis-plus-sharding-jdbc-spring-boot-starter

factory.setMapperLocations(this.properties.resolveMapperLocations());
origin: MIYAOW/MI-S

mybatisPlus.setMapperLocations(this.properties.resolveMapperLocations());
com.baomidou.mybatisplus.springMybatisSqlSessionFactoryBeansetMapperLocations

Popular methods of MybatisSqlSessionFactoryBean

  • <init>
  • setDataSource
  • setGlobalConfig
  • setConfigLocation
  • 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