Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
-
0b1099f7
by Tony Chemit at 2022-09-02T19:18:56+02:00
1 changed file:
Changes:
| ... | ... | @@ -59,7 +59,8 @@ public class OceanSpi extends GeneratedOceanSpi { |
| 59 | 59 | Set<String> newSpeciesWithThisOceanIds = dto.getSpecies().stream().map(SpeciesReference::getId).collect(Collectors.toSet());
|
| 60 | 60 | if (dto.isPersisted()) {
|
| 61 | 61 | // In that case, we could have some species to update by removing some ocean associations
|
| 62 | - try (Stream<Species> speciesStream = Species.loadEntities(context, s -> s.getOceanTopiaIds().contains(entity.getId()))) {
|
|
| 62 | + String thisOceanId = dto.getId();
|
|
| 63 | + try (Stream<Species> speciesStream = Species.loadEntities(context, s -> s.getOceanTopiaIds().contains(thisOceanId))) {
|
|
| 63 | 64 | speciesStream.forEach(oldSpeciesWithThisOcean -> {
|
| 64 | 65 | String oldSpeciesWithThisOceanId = oldSpeciesWithThisOcean.getTopiaId();
|
| 65 | 66 | if (!newSpeciesWithThisOceanIds.contains(oldSpeciesWithThisOceanId)) {
|