org.springframework.jdbc.datasource.ShardingKeyDataSourceAdapter .
Can be used as a functional interface (e.g. with a lambda expression) for a simple sharding key, or as a two-method interface when including a super sharding key as well.
ShardingKeyDataSourceAdapter#setShardingKeyProvider
| Modifier and Type | Method and Description |
|---|---|
| public ShardingKey | Returns: the sharding key, ornull if it is not available or cannot be determinedDetermine the sharding key. |
| public default ShardingKey | Returns: the super sharding key, ornull if it is not available or cannot be
determined (the default)Determine the super sharding key, if any. |
| getShardingKey | back to summary |
|---|---|
| public ShardingKey getShardingKey() throws SQLException Determine the sharding key. This method returns the sharding key relevant to the current context which will be used to obtain a direct shard connection.
| |
| getSuperShardingKey | back to summary |
|---|---|
| public default ShardingKey getSuperShardingKey() throws SQLException Determine the super sharding key, if any. This method returns the super sharding key relevant to the current context which will be used to obtain a direct shard connection.
| |