objectbox / objectbox/objectbox-java
@Unique: more on conflict options
Personne n'a encore pris cette issue.
- Langage dominant
- Java
- Étoiles
- 4.6k
- Forks
- 311
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
@Unique currently supports FAIL and REPLACE that are compatible with Sync.
Proposal to add more options (that likely will not work with Sync):
@Unique(onConflict=IGNORE): ignore the offending object (no changes to the existing conflicting object). If there are multiple unique properties in an entity, this strategy is evaluated first:
if the property conflicts, no other properties will be checked for conflicts.
@Unique(onConflict=UPDATE): the offending object overwrites the existing conflicting object while keeping its ID. Thus, all relations pointing to the existing entity stay intact.
This is useful for a "secondary" ID, e.g. a string "ID". Within an entity, this strategy may be used once only (update target would be ambiguous otherwise).
Multiple strategies in an entity are processed in this order: IGNORE, FAIL, REPLACE, UPDATE.
Originally posted by @greenrobot in https://github.com/objectbox/objectbox-java/issues/509#issuecomment-425055199
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Utilisez cette issue comme point de départ et examinez d’abord comment @Unique gère actuellement FAIL et REPLACE. Considérez le travail terminé lorsqu’il prend en charge les comportements proposés IGNORE et UPDATE, y compris leur ordre, la sémantique de mise à jour préservant les relations et la restriction concernant plusieurs stratégies UPDATE ; le payload ne nomme aucun fichier ni aucun test.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- java
- Domaine
- databases
- Type d'issue
- Fonctionnalité
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100