Examples of ShardResolutionStrategyData


Examples of org.hibernate.shards.strategy.selection.ShardResolutionStrategyData

    HiveShardResolver resolver = new HiveShardResolver(config, hive);

    indexer.insert(config.getEntityConfig(Continent.class), asia);
    indexer.insert(config.getEntityConfig(WeatherReport.class), report);

    ShardResolutionStrategyData continentData = new ShardResolutionStrategyDataImpl(Continent.class, asia.getName());
    ShardResolutionStrategyData reportData = new ShardResolutionStrategyDataImpl(WeatherReport.class, report.getReportId());

    Collection<ShardId> asiaIds = resolver.selectShardIdsFromShardResolutionStrategyData(continentData);
    Collection<ShardId> reportIds = resolver.selectShardIdsFromShardResolutionStrategyData(reportData);

    assertNotNull(asiaIds);
View Full Code Here

Examples of org.makersoft.shards.strategy.resolution.ShardResolutionStrategyData

  /**
   * 通过statement和parameter确定分区 如果parameter中可以提取出主键ID,首先通过ID去确定唯一分区
   */
  private List<Shard> determineShardsObjectsViaResolutionStrategy(String statement,
      Object parameter, Serializable id) {
    ShardResolutionStrategyData srsd = new ShardResolutionStrategyDataImpl(statement,
        parameter, id);
    List<ShardId> shardIds = this.selectShardIdsFromShardResolutionStrategyData(srsd);
    return shardIdListToShardList(shardIds);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.