return shard.getShardIds().iterator().next();
} else {
//TODO(fengkuok) 似乎从来不会走到这个逻辑
IdGenerator idGenerator = shardedSqlSessionFactory.getIdGenerator();
if (idGenerator != null) {
return idGenerator.extractShardId(this.extractId(parameter));
} else {
// TODO(tomislav): also use shard resolution strategy if it returns only 1 shard;
// throw this error in config instead of here
throw new RuntimeException(
"Can not use virtual sharding with non-shard resolving id gen");