microsoft / spring-data-cosmosdb

Access data with Azure Cosmos DB
MIT License
93 stars 68 forks source link

How to declare @id as java.util.UUID (instead of only String or Int) #431

Open alain-marcel opened 4 years ago

alain-marcel commented 4 years ago

Currently, we can only use String, Integer or int types as a @id. Would it be possible to add java.util.UUID ? This type is natively support in many databases. It would be great in the domain entity class to use a java.util.UUID instead of String. I currently use a home made library to access cosmosdb/documentdb, that manage id as UUID. I want to migrate to spring data comsosdb library, and this issue is the only lock.

If you do not plan to add this feature soon, could you indicate a workaround ? It is not easy to overload "private Field getIdField(Class<?> domainClass)" method of com.microsoft.azure.spring.data.cosmosdb.repository.support.DocumentDbEntityInformation class because method is private...

Thanks for any help.

kushagraThapar commented 4 years ago

I believe this issue can be generalized through : https://github.com/microsoft/spring-data-cosmosdb/issues/539

helayoty commented 3 years ago

Do we have a date for fixing this issue?

alain-marcel commented 3 years ago

Hi It would be great if you can accept UUID as @Id in Entity. All our applications use that, so I have to patch each version of spring-data-cosmos to add UUID and correct trouble in version. Please find attached the patch for 3.0.0 version.

Alain Marcel

De : Heba Elayoty notifications@github.com Envoyé : lundi 26 octobre 2020 17:19 À : microsoft/spring-data-cosmosdb spring-data-cosmosdb@noreply.github.com Cc : MARCEL Alain alain.MARCEL@lpgsystems.com; Author author@noreply.github.com Objet : Re: [microsoft/spring-data-cosmosdb] How to declare @id as java.util.UUID (instead of only String or Int) (#431)

Do we have a date for fixing this issue?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/microsoft/spring-data-cosmosdb/issues/431#issuecomment-716659121, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALBYLYF3OILH64BYMNNMNJ3SMWOQXANCNFSM4I2QBSRA.

Ce message et toutes les pièces jointes sont établis à l’attention exclusive de ses destinataires et sont confidentiels. Si vous recevez ce message par erreur, merci de le détruire et d’en avertir immédiatement l’expéditeur. Toute utilisation de ce message non conforme à sa destination, toute diffusion ou toute publication, totale ou partielle, est interdite, sauf autorisation expresse. L’internet ne permettant pas d’assurer l’intégrité de ce message, LPG SYSTEMS décline toute responsabilité au titre de ce message, dans l’hypothèse où il aurait été modifié. Conformément aux dispositions de la loi « Informatique et Libertés » modifiée et du Règlement européen sur la protection des données (RGPD), nous vous informons que les données personnelles contenues dans cette communication ont été collectées à partir de contacts entretenus avec vous ou de sources accessibles au public. Les données fournies seront conservées tant que notre relation est maintenue ou pendant les années nécessaires pour se conformer à nos obligations légales. Les données ne seront pas transférées à des tiers sauf dans les cas où il existe une obligation légale. Vous pouvez exercer, à tout moment, vos droits d'accès, de rectification, de limitation de traitement, de suppression, de portabilité ou d'opposition au traitement de vos données personnelles ainsi que le retrait du consentement donné pour leur traitement ou votre droit de faire connaître vos instructions concernant la manière dont vous entendez que vos droits soient exercés après votre décès en adressant votre demande à LPG SYSTEMS, Service Relation Clients, Technoparc de la Plaine, CS90035, 30-35 rue du Docteur Abel, 26902 Valence Cedex 9. ou en envoyant un email à dataprivacy@lpgsystems.com. Vous pouvez également introduire une réclamation auprès d’une autorité de contrôle.

This message and any attachments is intended solely for the addressees and is confidential. If you receive this message in error, please delete it and immediately notify the sender. Any use not in accord with its purpose, any dissemination or disclosure, either whole or partial, is prohibited except formal approval. The internet cannot guarantee the integrity of this message. LPG SYSTEMS will not therefore be liable for the message if modified. In compliance with the provisions of the current French Act n° 78-17 of January 6, 1978, modified, on protection of personal data, and the General Data Protection Regulations 2016/679 (RGPD), we inform you that personal data contained in this communication have been collected from contacts maintained with you or from sources accessible to the public. The data provided will be kept as long as our relationship is maintained or during the necessary years to comply with our legal obligations. The data will not be transferred to third parties except in cases where there is a legal obligation. You can exercise, at any time, the rights of access, rectification, limitation of treatment, deletion, portability, opposition to the processing of your personal or withdrawal of the consent given for the treatment thereof as well as your right to set guidelines for the processing of your data after your death, directing your request to LPG SYSTEMS, Service Relation Clients, Technoparc de la Plaine, CS90035, 30-35 rue du Docteur Abel, 26902 Valence Cedex 9.or sending an email to dataprivacy@lpgsystems.com. You can also lodge a complaint with a supervisory authority.

kushagraThapar commented 3 years ago

@alain-marcel - we only support strings and int / numbers for id annotation as of now. Also, we have moved our code base to new repository - https://github.com/Azure/azure-sdk-for-java/tree/master/sdk/cosmos/azure-spring-data-cosmos So new issues should be filed there.

For now, let's ask @mbhaskar - can you please take a look at this issue?