Tony CHEMIT pushed to branch develop-9.0.x at ultreiaio / ird-observe
Commits:
-
ee52baba
by Tony Chemit at 2023-03-10T18:51:38+01:00
-
e4ecc3d7
by Tony Chemit at 2023-03-10T20:30:54+01:00
3 changed files:
- core/persistence/consolidation/src/main/java/fr/ird/observe/consolidation/data/ps/observation/ActivityConsolidateEngine.java
- pom.xml
- toolkit/api/src/main/java/fr/ird/observe/dto/ToolkitIdModifications.java
Changes:
| ... | ... | @@ -100,8 +100,10 @@ public class ActivityConsolidateEngine { |
| 100 | 100 | if (r.withWarnings()) {
|
| 101 | 101 | log.info(String.format("%s Found some warnings on activity: %s - %s", activityPrefix, activity.getTopiaId(), r.getActivityLabel()));
|
| 102 | 102 | }
|
| 103 | - |
|
| 104 | - |
|
| 103 | + if (r.getCatchModifications() != null) {
|
|
| 104 | + // Replace in modifications any entity by his id (only necessary for catches modifications)
|
|
| 105 | + r.getCatchModifications().forEach(ToolkitIdModifications::replaceToolkitIdReferencesById);
|
|
| 106 | + }
|
|
| 105 | 107 | });
|
| 106 | 108 | return result;
|
| 107 | 109 | } catch (Exception e) {
|
| ... | ... | @@ -23,7 +23,7 @@ |
| 23 | 23 | <parent>
|
| 24 | 24 | <groupId>io.ultreia.maven</groupId>
|
| 25 | 25 | <artifactId>pom</artifactId>
|
| 26 | - <version>2023.11</version>
|
|
| 26 | + <version>2023.12</version>
|
|
| 27 | 27 | </parent>
|
| 28 | 28 | <groupId>fr.ird.observe</groupId>
|
| 29 | 29 | <artifactId>ird-observe</artifactId>
|
| ... | ... | @@ -128,7 +128,6 @@ |
| 128 | 128 | <!-- FIXME <lib.version.jts>1.18.2</lib.version.jts>-->
|
| 129 | 129 | <lib.version.hsqldb>2.7.0</lib.version.hsqldb>
|
| 130 | 130 | <!-- FIXME <lib.version.hsqldb>2.7.1</lib.version.hsqldb>-->
|
| 131 | - <lib.version.java4all.java-lang>2.0.5</lib.version.java4all.java-lang>
|
|
| 132 | 131 | <!-- license header configuration -->
|
| 133 | 132 | <license.licenseName>gpl_v3</license.licenseName>
|
| 134 | 133 | <license.organizationName>IRD, Ultreia.io</license.organizationName>
|
| ... | ... | @@ -79,4 +79,15 @@ public class ToolkitIdModifications extends JavaBeanModifications implements Jso |
| 79 | 79 | public int warningsCount() {
|
| 80 | 80 | return getWarnings() == null ? 0 : getWarnings().size();
|
| 81 | 81 | }
|
| 82 | + |
|
| 83 | + public void replaceToolkitIdReferencesById() {
|
|
| 84 | + for (JavaBeanPropertyModification modification : getModifications()) {
|
|
| 85 | + if (modification.getOldValue() instanceof ToolkitId) {
|
|
| 86 | + modification.setOldValue(((ToolkitId) modification.getOldValue()).getTopiaId());
|
|
| 87 | + }
|
|
| 88 | + if (modification.getNewValue() instanceof ToolkitId) {
|
|
| 89 | + modification.setNewValue(((ToolkitId) modification.getNewValue()).getTopiaId());
|
|
| 90 | + }
|
|
| 91 | + }
|
|
| 92 | + }
|
|
| 82 | 93 | } |