Package org.makersoft.shards.session.impl

Examples of org.makersoft.shards.session.impl.ShardedSqlSessionFactoryBuilder


    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


    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());

    Assert.assertNotNull(factory);

    factory = new ShardedSqlSessionFactoryBuilder().build(shardConfigs,
        new ShardStrategyFactory() {

          @Override
          public ShardStrategy newShardStrategy(List<ShardId> shardIds) {
            ShardSelectionStrategy pss = new ShardSelectionStrategy() {
View Full Code Here

TOP

Related Classes of org.makersoft.shards.session.impl.ShardedSqlSessionFactoryBuilder

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.