microsoft / spring-data-cosmosdb

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

Support SpEL expression resolution for @Document "collection" field #391

Closed dsibilio closed 4 years ago

dsibilio commented 5 years ago

It would be nice to be able to dynamically load a collection name using SpEL expressions.

Examples:

Pull Requests

https://github.com/microsoft/spring-data-cosmosdb/pull/390

Thommynator commented 5 years ago

Hi, this feature would be really helpful. 👍 Right now I'm looking for a way to make the collection name configurable by a property file like in the first option.

I noticed that the pull request has merge conflicts. Are there any plans to add this feature in the near future? :)

Can anyone tell me the best practice for making the collection name configurable without this change?

dsibilio commented 5 years ago

I noticed that the pull request has merge conflicts.

Thanks for noticing, I pulled the changes and solved the conflicts. The Travis CI pipeline for integration tests seems to be broken though :(

Can anyone tell me the best practice for making the collection name configurable without this change?

Without this feature, I think you'd have to work with changing the collection name reflectively at runtime (e.g. https://www.baeldung.com/java-reflection-change-annotation-params)

christopheranderson commented 5 years ago

@kushagraThapar - can you take a look at this?

kushagraThapar commented 4 years ago

@dsibilio I have moved the travis CI to Azure DevOps CI, which supports running the CI on PRs from forked repository. I have tried running that on your PR, but there are still some hiccups. I will fix that asap.

dsibilio commented 4 years ago

@kushagraThapar Thank you, let me know if I can help you with anything.

kushagraThapar commented 4 years ago

@dsibilio CI is running successfully on external PRs now. I will take a look at the PR tomorrow.