Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe

Commits:

1 changed file:

Changes:

  • core/persistence/java/src/main/java/fr/ird/observe/entities/referential/common/OceanSpi.java
    ... ... @@ -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)) {