Class PartitionKeyDefinition


  • public final class PartitionKeyDefinition
    extends Object
    Represents a partition key definition in the Azure Cosmos DB database service. A partition key definition specifies which item property is used as the partition key in a container that has multiple partitions.
    • Constructor Detail

      • PartitionKeyDefinition

        public PartitionKeyDefinition()
        Constructor. Creates a new instance of the PartitionKeyDefinition object.
    • Method Detail

      • getKind

        public PartitionKind getKind()
        Sets the partition algorithm used to calculate the partition id given a partition key.
        Returns:
        the partition algorithm.
      • setKind

        public PartitionKeyDefinition setKind​(PartitionKind kind)
        Sets the partition algorithm used to calculate the partition id given a partition key.
        Parameters:
        kind - the partition algorithm.
        Returns:
        this PartitionKeyDefinition.
      • getPaths

        public List<String> getPaths()
        Gets the item property paths for the partition key.
        Returns:
        the paths to the item properties that form the partition key.
      • setPaths

        public PartitionKeyDefinition setPaths​(List<String> paths)
        Sets the item property paths for the partition key.
        Parameters:
        paths - the paths to item properties that form the partition key.
        Returns:
        this PartitionKeyDefinition.
        Throws:
        IllegalArgumentException - thrown if an error occurs