Package oracle.jdbc.pool
Class OracleShardingKeyBuilderImpl
- java.lang.Object
-
- oracle.jdbc.pool.OracleShardingKeyBuilderImpl
-
- All Implemented Interfaces:
ShardingKeyBuilder
,OracleShardingKeyBuilder
public class OracleShardingKeyBuilderImpl extends Object implements OracleShardingKeyBuilder
-
-
Field Summary
Fields Modifier and Type Field Description static long
DEFAULT_ORA_HASH
-
Constructor Summary
Constructors Constructor Description OracleShardingKeyBuilderImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OracleShardingKeyImpl
build()
Builds the sharding key with the sub keys provided and their default metadata.OracleShardingKeyBuilderImpl
oraHash(long oraHash)
Used to build the shard key with the known ORA HASH value.OracleShardingKeyBuilderImpl
subkey(Object subkey, SQLType subkeyType)
This method is called to include a subkey into a sharding key object being built.
-
-
-
Field Detail
-
DEFAULT_ORA_HASH
public static final long DEFAULT_ORA_HASH
- See Also:
- Constant Field Values
-
-
Method Detail
-
subkey
public OracleShardingKeyBuilderImpl subkey(Object subkey, SQLType subkeyType)
This method is called to include a subkey into a sharding key object being built. The order in which subkey method is called is important as it indicates the order of placement of the subkey within the sharding key.- Specified by:
subkey
in interfaceOracleShardingKeyBuilder
- Specified by:
subkey
in interfaceShardingKeyBuilder
- Parameters:
subkey
- contains the object that needs to be part of sharding sub keysubkeyType
- sub-key data type which can be specified using one of the types from java.sql.JDBCType or oracle.jdbc.OracleType- Returns:
- this builder object
- See Also:
OracleShardingKeyBuilder.subkey(java.lang.Object, java.sql.SQLType)
-
oraHash
public OracleShardingKeyBuilderImpl oraHash(long oraHash)
Used to build the shard key with the known ORA HASH value. This is used to optimize sharding key comparisons for hash based sharding.- Parameters:
oraHash
- the known ORA HASH value for the shard key that is being built.- Returns:
- this builder object
-
build
public OracleShardingKeyImpl build()
Builds the sharding key with the sub keys provided and their default metadata. The sharding key object built is immutable. The build() method can be called only once on a builder object, subsequent attempts to call build() will result in IllegalStateException.- Specified by:
build
in interfaceOracleShardingKeyBuilder
- Specified by:
build
in interfaceShardingKeyBuilder
- Returns:
- returns the new sharding key object that is built
- See Also:
OracleShardingKeyBuilder.build()
-
-