oracle.jdbc.pool

## Class ShardingMetadata

- java.lang.Object
- - oracle.jdbc.pool.ShardingMetadata

    public class ShardingMetadata
    extends Object

Holds the Sharded Database metadata that is required during encoding and decoding of sharding keys. The metadata is normally populated after the first connection to the database is established. The metadata object is designed to be immutable once created.

### Nested Class Summary

Nested Classes
`static class` `ShardingMetadata.ShardingType` Enum to hold the different sharding methods supported for shard keys and shard groups in the Oracle sharded database.
`static class` `ShardingMetadata.SubKeyMetadata` Holds the shard sub key metadata information extracted from the database.

### Field Summary

Fields
`static int` `SHARDING_KEY_LEVEL`
`static int` `SUPER_SHARDING_KEY_LEVEL`

### Constructor Summary

Constructors
Constructor and Description
`ShardingMetadata(int version, ShardingMetadata.ShardingType shardingType, ShardingMetadata.ShardingType superShardingType, List<ShardingMetadata.SubKeyMetadata> keyColumns, List<ShardingMetadata.SubKeyMetadata> superKeyColumns)` Constructs an immutable object with all the metadata information.

### Method Summary

All Methods Instance Methods Concrete Methods
`List<ShardingMetadata.SubKeyMetadata>` `getShardingKeyColumns()`
`ShardingMetadata.ShardingType` `getShardingType()`
`List<ShardingMetadata.SubKeyMetadata>` `getSuperShardingKeyColumns()`
`ShardingMetadata.ShardingType` `getSuperShardingType()`
`int` `getVersion()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### SUPER_SHARDING_KEY_LEVEL

    public static final int SUPER_SHARDING_KEY_LEVEL

See Also:
  Constant Field Values

#### SHARDING_KEY_LEVEL

    public static final int SHARDING_KEY_LEVEL

See Also:
  Constant Field Values

### Constructor Detail

#### ShardingMetadata

    public ShardingMetadata(int version,
                            ShardingMetadata.ShardingType shardingType,
                            ShardingMetadata.ShardingType superShardingType,
                            List<ShardingMetadata.SubKeyMetadata> keyColumns,
                            List<ShardingMetadata.SubKeyMetadata> superKeyColumns)

Constructs an immutable object with all the metadata information.

Parameters:
  `version` - version of the metadata object being built
  `shardingType` - sharding type in the database
  `superShardingType` - super sharding type in the database
  `keyColumns` - sub key column metadata for sharding sub keys on the database
  `superKeyColumns` - sub key column metadata for sub keys of the super sharding key on the database

### Method Detail

#### getVersion

    public int getVersion()

Returns:
  version of this metadata

#### getShardingType

    public ShardingMetadata.ShardingType getShardingType()

Returns:
  sharding type in the metadata

#### getSuperShardingType

    public ShardingMetadata.ShardingType getSuperShardingType()

Returns:
  super sharding type in the metadata

#### getShardingKeyColumns

    public List<ShardingMetadata.SubKeyMetadata> getShardingKeyColumns()

Returns:
  list of sharding sub key column metadata

#### getSuperShardingKeyColumns

    public List<ShardingMetadata.SubKeyMetadata> getSuperShardingKeyColumns()

Returns:
  list of super sharding sub key columns metadata

Copyright © 2008, 2020, Oracle and/or its affiliates. All rights reserved.