microsoft / spring-data-cosmosdb

Access data with Azure Cosmos DB
MIT License
94 stars 64 forks source link

Custom partition key name #383

Closed kxmas closed 4 years ago

kxmas commented 5 years ago

I use snake case for json serialization, but the @PartitionKey annotation only uses the java field name. This PR addresses that mismatch.

@PartitionKey("partition_key")
String partitionKey;
kxmas commented 5 years ago

Codacy Here is an overview of what got changed by this pull request:

Issues
======
- Added 2

See the complete overview on Codacy

I am unsure as how to satisfy these two Codacy demands. It's complaining about the two small entity classes that I added to the DocumentDbEntityInformationUnitTest in order to properly test the enhancement.

kxmas commented 5 years ago

@Incarnation-p-lee Adding an unused getter and setter fixed the unused field issue. Thanks.

Incarnation-p-lee commented 5 years ago

@kxmas Great, seems the travis CI has some network issue for integration test. I will trigger the build later.

kxmas commented 5 years ago

@kxmas Great, seems the travis CI has some network issue for integration test. I will trigger the build later.

The Travis CI build pipeline appears to be broken. I didn't look too hard, but I can't find a PR where it succeeded.

TestPartitionedPaginationQuery(com.microsoft.azure.spring.data.cosmosdb.core.DocumentDbTemplatePartitionIT)  Time elapsed: 0.261 sec  <<< ERROR!
java.lang.IllegalArgumentException: cosmosdb host key should have text!
    at com.microsoft.azure.spring.data.cosmosdb.core.DocumentDbTemplatePartitionIT.setup(DocumentDbTemplatePartitionIT.java:71)
testPartitionedPaginationQuery(com.microsoft.azure.spring.data.cosmosdb.core.DocumentDbTemplatePartitionIT)  Time elapsed: 0.263 sec  <<< ERROR!
java.lang.NullPointerException
    at com.microsoft.azure.spring.data.cosmosdb.core.DocumentDbTemplatePartitionIT.cleanup(DocumentDbTemplatePartitionIT.java:90)
kushagraThapar commented 4 years ago

@kxmas can you please resolve the conflicts, so I can run additional CI to make sure we are good with all the tests.

kxmas commented 4 years ago

Done

kushagraThapar commented 4 years ago

/azp run

azure-pipelines[bot] commented 4 years ago
No pipelines are associated with this pull request.