Closed otaviojava closed 6 years ago
@otaviojava Thanks for the PR and sorry for the delayed update on this.
We decided to have support for object mapping outside of SDK as part of Spring project (https://github.com/Microsoft/spring-data-cosmosdb). So we have to reject the PR.
Adds support to a Mapper that's a wrapper that abstracts these operations to an entity.
E.g.: Given an Person entity:
You can create a Mapper unit that will handle the operations related to a particular class.
:warning: Both MappingManager and Mapper should have one instance at Application scope, that is easily handled with frameworks like Spring or CDI.
Remain tasks:
Next steps to improve the Mapper
IMHO: This PR is just the first step to move forward an easy integration with Mapper.
1) The Repository interface is given an interface that has basic methods a Java developer just need to extend it, so the interface will already be implemented by the Mapper manager.
Done: check: https://github.com/Azure/azure-cosmosdb-java/pull/45 2) Support by query by annotation
Done: check: https://github.com/Azure/azure-cosmosdb-java/pull/45
3) And the old, but gold query by the method where the developer writes the method using conventions and the mapper will down the implementation.