你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
PartitionKeyDefinition Class
- java.
lang. Object - com.
microsoft. azure. documentdb. JsonSerializable - com.
microsoft. azure. documentdb. PartitionKeyDefinition
- com.
- com.
public final class PartitionKeyDefinition
extends JsonSerializable
Represents a partition key definition in the Azure Cosmos DB database service. A partition key definition specifies which document property is used as the partition key in a collection that has multiple partitions.
Constructor Summary
Constructor | Description |
---|---|
PartitionKeyDefinition() |
Constructor. |
PartitionKeyDefinition(String jsonString) |
Constructor. |
PartitionKeyDefinition(JSONObject jsonObject) |
Constructor. |
Method Summary
Modifier and Type | Method and Description |
---|---|
Partition |
getKind()
Sets the partition algorithm used to calculate the partition id given a partition key. |
java.util.Collection<java.lang.String> |
getPaths()
Gets the document property paths for the partition key. |
Partition |
getVersion() |
void |
setKind(PartitionKind kind)
Sets the partition algorithm used to calculate the partition id given a partition key. |
void |
setPaths(Collection<String> paths)
Sets the document property paths for the partition key. |
void | setVersion(PartitionKeyDefinitionVersion version) |
Methods inherited from JsonSerializable
Methods inherited from java.lang.Object
Constructor Details
PartitionKeyDefinition
public PartitionKeyDefinition()
Constructor. Creates a new instance of the PartitionKeyDefinition object.
PartitionKeyDefinition
public PartitionKeyDefinition(String jsonString)
Constructor. Creates a new instance of the PartitionKeyDefinition object from a JSON string.
Parameters:
PartitionKeyDefinition
public PartitionKeyDefinition(JSONObject jsonObject)
Constructor. Creates a new instance of the PartitionKeyDefinition object from a JSON object.
Parameters:
Method Details
getKind
public PartitionKind getKind()
Sets the partition algorithm used to calculate the partition id given a partition key.
Returns:
getPaths
public Collection
Gets the document property paths for the partition key.
Returns:
getVersion
public PartitionKeyDefinitionVersion getVersion()
setKind
public void setKind(PartitionKind kind)
Sets the partition algorithm used to calculate the partition id given a partition key.
Parameters:
setPaths
public void setPaths(Collection
Sets the document property paths for the partition key.
Parameters:
setVersion
public void setVersion(PartitionKeyDefinitionVersion version)
Parameters: