Skip to content
This repository has been archived by the owner on Feb 8, 2022. It is now read-only.

Duplicates within relations #30

Closed
zebroc opened this issue Feb 28, 2017 · 1 comment
Closed

Duplicates within relations #30

zebroc opened this issue Feb 28, 2017 · 1 comment

Comments

@zebroc
Copy link

zebroc commented Feb 28, 2017

Duplicate entries of relations are created, when the parent entity is being updated.

Scenario: The app fetches data from an API & stores it in a table, this is the model:

Tour {
List(Place) places;

}

Step 1: App fetches data, like fetchAllTours()
Step 2: A tour is added on API side, i.e. all existing tours stay the same --> fetchAllTours()

All the existing tours get updated in the DB now, but each time a new row in the pivot table ("TOUR_PLACE") is being created. Resulting in duplicates: Getting one of the already existing Tours from the DB will now have each place twice.

@graphee-gabriel
Copy link
Contributor

graphee-gabriel commented Aug 22, 2017

I have the same problem
Setting @Id on the ID field i get from Json, seems to override the ID from the server by an autogenerated ID.
It therefores creates duplicates.

@zebroc zebroc closed this as completed Jun 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants