Package org.makersoft.shards.cfg.impl

Examples of org.makersoft.shards.cfg.impl.ShardConfigurationImpl


        factoryBean.setTypeAliases(this.typeAliases);
        factoryBean.setTypeAliasesPackage(this.typeAliasesPackage);
       
        SqlSessionFactory sessionFacotry = factoryBean.getObject();
       
        shardConfigs.add(new ShardConfigurationImpl(shardId, dataSource, sessionFacotry));
      }
    }else {
      for(ShardConfigurationImpl shardConfiguration : shardConfigurations){
       
        Assert.notNull(shardConfiguration.getShardId(), "shard id can not be null.");
View Full Code Here


    final Reader reader_1 = Resources.getResourceAsReader(resource_1);
   
    SqlSessionFactory sqlMapper_0 = new SqlSessionFactoryBuilder().build(reader_0);
    SqlSessionFactory sqlMapper_1 = new SqlSessionFactoryBuilder().build(reader_1);
   
    shardConfigs.add(new ShardConfigurationImpl(0, sqlMapper_0.getConfiguration().getEnvironment().getDataSource(), sqlMapper_0));
    shardConfigs.add(new ShardConfigurationImpl(1, sqlMapper_1.getConfiguration().getEnvironment().getDataSource(), sqlMapper_1));
   
    factory = new ShardedSqlSessionFactoryBuilder().build(shardConfigs, new UserShardStrategyFactory());
   
    Assert.assertNotNull(factory);
  }
View Full Code Here

    SqlSessionFactory sqlMapper_0 = new SqlSessionFactoryBuilder().build(reader_0);
    SqlSessionFactory sqlMapper_1 = new SqlSessionFactoryBuilder().build(reader_1);
    SqlSessionFactory sqlMapper_2 = new SqlSessionFactoryBuilder().build(reader_2);

    shardConfigs.add(new ShardConfigurationImpl(0, sqlMapper_0.getConfiguration()
        .getEnvironment().getDataSource(), sqlMapper_0));
    shardConfigs.add(new ShardConfigurationImpl(1, sqlMapper_1.getConfiguration()
        .getEnvironment().getDataSource(), sqlMapper_1));
    shardConfigs.add(new ShardConfigurationImpl(2, sqlMapper_2.getConfiguration()
        .getEnvironment().getDataSource(), sqlMapper_2));

    factory = new ShardedSqlSessionFactoryBuilder().build(shardConfigs,
        new UserShardStrategyFactory());
View Full Code Here

TOP

Related Classes of org.makersoft.shards.cfg.impl.ShardConfigurationImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.