@Deepak Patil - please create a github issue here - https://github.com/Azure/azure-sdk-for-java/issues
We can discuss your problem in more detail.
Composite Key azure cosmos java

@alrt
@MetContainer (containerName = "tag")
@TostringsOwO
@EqualsAndHashCode
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
@NoArgsConstructor
@AllArgsConstructor
public class Tag {
@Id
private String tagName;
@Id
private String domainName;
@PartitionKey
private String countryDcOrgUnit;
}
I need to create container with name tag having tagName and domainName as unique combination.... but after running this i am getting error .. only one field with @Id annotation!
how to crate container with composite key as primary key
-
Kushagra Thapar 76 Reputation points Microsoft Employee
2022-02-07T17:37:23.737+00:00 1 additional answer
Sort by: Most helpful
-
Oury Ba-MSFT 10,331 Reputation points Microsoft Employee
2022-03-01T00:51:24.953+00:00 You can use the feature of Nested Partition Key Path in azure-spring-data-cosmos to solve the unique key problem in spring - https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/cosmos/azure-spring-data-cosmos/README.md#nested-partition-key-support.
-
Yes..Azure Cosmos Integration with JPA(ReactiveCosmosRepository)