UniqueKey Class
- java.
lang. Object - com.
azure. cosmos. models. UniqueKey
- com.
public final class UniqueKey
Represents a unique key on that enforces uniqueness constraint on items in the container in the Azure Cosmos DB service.
For containers, the value of partition key is implicitly a part of each unique key.
Uniqueness constraint is also enforced for missing values.
For instance, if unique key policy defines a unique key with single property path, there could be only one item that has missing value for this property.
Constructor Summary
Constructor | Description |
---|---|
UniqueKey(List<String> paths) |
Instantiates a new Unique key with paths. |
Method Summary
Modifier and Type | Method and Description |
---|---|
List<String> |
getPaths()
Gets the paths, a set of which must be unique for each item in the Azure Cosmos DB service. |
Unique |
setPaths(List<String> paths)
Sets the paths, a set of which must be unique for each item in the Azure Cosmos DB service. |
Methods inherited from java.lang.Object
Constructor Details
UniqueKey
public UniqueKey(List
Instantiates a new Unique key with paths.
Parameters:
Method Details
getPaths
public List
Gets the paths, a set of which must be unique for each item in the Azure Cosmos DB service.
The paths to enforce uniqueness on. Each path is a rooted path of the unique property in the item, such as "/name/first".
Returns:
setPaths
public UniqueKey setPaths(List
Sets the paths, a set of which must be unique for each item in the Azure Cosmos DB service.
The paths to enforce uniqueness on. Each path is a rooted path of the unique property in the item, such as "/name/first".
Parameters:
Returns:
Applies to
Azure SDK for Java