Tony CHEMIT pushed to branch master-7.x at ultreiaio / ird-observe
Commits:
-
89f1244e
by tchemit at 2019-05-06T12:03:13Z
-
56293427
by tchemit at 2019-05-06T12:09:52Z
-
923006e8
by tchemit at 2019-05-06T12:09:52Z
-
d1c0e65b
by tchemit at 2019-05-06T12:09:53Z
-
43c3f745
by tchemit at 2019-05-10T14:48:20Z
-
56f88bf2
by tchemit at 2019-05-13T11:42:54Z
-
25874e1c
by tchemit at 2019-05-13T18:14:48Z
-
83b59311
by tchemit at 2019-05-13T18:33:25Z
17 changed files:
- client-configuration/pom.xml
- client-core/pom.xml
- client-runner/pom.xml
- dto/pom.xml
- observe-i18n/pom.xml
- observe/pom.xml
- persistence/pom.xml
- pom.xml
- server-configuration/pom.xml
- server-core/pom.xml
- server-runner/pom.xml
- services-client/pom.xml
- services-local/pom.xml
- services-local/src/main/java/fr/ird/observe/services/local/service/actions/synchro/referential/sql/DeleteSqlStatementGenerator.java
- services/pom.xml
- test/pom.xml
- validation/pom.xml
Changes:
| ... | ... | @@ -26,7 +26,7 @@ |
| 26 | 26 |
<parent>
|
| 27 | 27 |
<groupId>fr.ird.observe</groupId>
|
| 28 | 28 |
<artifactId>ird-observe</artifactId>
|
| 29 |
- <version>7.0.6</version>
|
|
| 29 |
+ <version>7.0.7</version>
|
|
| 30 | 30 |
</parent>
|
| 31 | 31 |
|
| 32 | 32 |
<artifactId>client-configuration</artifactId>
|
| ... | ... | @@ -26,7 +26,7 @@ |
| 26 | 26 |
<parent>
|
| 27 | 27 |
<groupId>fr.ird.observe</groupId>
|
| 28 | 28 |
<artifactId>ird-observe</artifactId>
|
| 29 |
- <version>7.0.6</version>
|
|
| 29 |
+ <version>7.0.7</version>
|
|
| 30 | 30 |
</parent>
|
| 31 | 31 |
|
| 32 | 32 |
<artifactId>client-core</artifactId>
|
| ... | ... | @@ -26,7 +26,7 @@ |
| 26 | 26 |
<parent>
|
| 27 | 27 |
<groupId>fr.ird.observe</groupId>
|
| 28 | 28 |
<artifactId>ird-observe</artifactId>
|
| 29 |
- <version>7.0.6</version>
|
|
| 29 |
+ <version>7.0.7</version>
|
|
| 30 | 30 |
</parent>
|
| 31 | 31 |
|
| 32 | 32 |
<artifactId>client-runner</artifactId>
|
| ... | ... | @@ -27,7 +27,7 @@ |
| 27 | 27 |
<parent>
|
| 28 | 28 |
<groupId>fr.ird.observe</groupId>
|
| 29 | 29 |
<artifactId>ird-observe</artifactId>
|
| 30 |
- <version>7.0.6</version>
|
|
| 30 |
+ <version>7.0.7</version>
|
|
| 31 | 31 |
</parent>
|
| 32 | 32 |
|
| 33 | 33 |
<artifactId>dto</artifactId>
|
| ... | ... | @@ -26,7 +26,7 @@ |
| 26 | 26 |
<parent>
|
| 27 | 27 |
<groupId>fr.ird.observe</groupId>
|
| 28 | 28 |
<artifactId>ird-observe</artifactId>
|
| 29 |
- <version>7.0.6</version>
|
|
| 29 |
+ <version>7.0.7</version>
|
|
| 30 | 30 |
</parent>
|
| 31 | 31 |
|
| 32 | 32 |
<artifactId>observe-i18n</artifactId>
|
| ... | ... | @@ -26,7 +26,7 @@ |
| 26 | 26 |
<parent>
|
| 27 | 27 |
<groupId>fr.ird.observe</groupId>
|
| 28 | 28 |
<artifactId>ird-observe</artifactId>
|
| 29 |
- <version>7.0.6</version>
|
|
| 29 |
+ <version>7.0.7</version>
|
|
| 30 | 30 |
</parent>
|
| 31 | 31 |
|
| 32 | 32 |
<artifactId>observe</artifactId>
|
| ... | ... | @@ -26,7 +26,7 @@ |
| 26 | 26 |
<parent>
|
| 27 | 27 |
<groupId>fr.ird.observe</groupId>
|
| 28 | 28 |
<artifactId>ird-observe</artifactId>
|
| 29 |
- <version>7.0.6</version>
|
|
| 29 |
+ <version>7.0.7</version>
|
|
| 30 | 30 |
</parent>
|
| 31 | 31 |
|
| 32 | 32 |
<artifactId>persistence</artifactId>
|
| ... | ... | @@ -26,12 +26,12 @@ |
| 26 | 26 |
<parent>
|
| 27 | 27 |
<groupId>io.ultreia.maven</groupId>
|
| 28 | 28 |
<artifactId>pom</artifactId>
|
| 29 |
- <version>2019.8.15</version>
|
|
| 29 |
+ <version>2019.8.16</version>
|
|
| 30 | 30 |
</parent>
|
| 31 | 31 |
|
| 32 | 32 |
<groupId>fr.ird.observe</groupId>
|
| 33 | 33 |
<artifactId>ird-observe</artifactId>
|
| 34 |
- <version>7.0.6</version>
|
|
| 34 |
+ <version>7.0.7</version>
|
|
| 35 | 35 |
<packaging>pom</packaging>
|
| 36 | 36 |
|
| 37 | 37 |
<name>ObServe :: Pom</name>
|
| ... | ... | @@ -165,7 +165,7 @@ |
| 165 | 165 |
<lib.version.java4all.eugene>3.0-alpha-26</lib.version.java4all.eugene>
|
| 166 | 166 |
<lib.version.java4all.jaxx>3.0-alpha-50</lib.version.java4all.jaxx>
|
| 167 | 167 |
<!--<lib.version.java4all.i18n>4.0-beta-8-SNAPSHOT</lib.version.java4all.i18n>-->
|
| 168 |
- <lib.version.java4all.topia>1.1.12</lib.version.java4all.topia>
|
|
| 168 |
+ <lib.version.java4all.topia>1.1.13</lib.version.java4all.topia>
|
|
| 169 | 169 |
|
| 170 | 170 |
<!--<lib.version.nuiton.topia>3.6-SNAPSHOT</lib.version.nuiton.topia>-->
|
| 171 | 171 |
<!--<lib.version.java4all.eugene>3.0-alpha-21</lib.version.java4all.eugene>-->
|
| ... | ... | @@ -26,7 +26,7 @@ |
| 26 | 26 |
<parent>
|
| 27 | 27 |
<groupId>fr.ird.observe</groupId>
|
| 28 | 28 |
<artifactId>ird-observe</artifactId>
|
| 29 |
- <version>7.0.6</version>
|
|
| 29 |
+ <version>7.0.7</version>
|
|
| 30 | 30 |
</parent>
|
| 31 | 31 |
|
| 32 | 32 |
<artifactId>server-configuration</artifactId>
|
| ... | ... | @@ -27,7 +27,7 @@ |
| 27 | 27 |
<parent>
|
| 28 | 28 |
<groupId>fr.ird.observe</groupId>
|
| 29 | 29 |
<artifactId>ird-observe</artifactId>
|
| 30 |
- <version>7.0.6</version>
|
|
| 30 |
+ <version>7.0.7</version>
|
|
| 31 | 31 |
</parent>
|
| 32 | 32 |
|
| 33 | 33 |
<artifactId>server-core</artifactId>
|
| ... | ... | @@ -27,7 +27,7 @@ |
| 27 | 27 |
<parent>
|
| 28 | 28 |
<groupId>fr.ird.observe</groupId>
|
| 29 | 29 |
<artifactId>ird-observe</artifactId>
|
| 30 |
- <version>7.0.6</version>
|
|
| 30 |
+ <version>7.0.7</version>
|
|
| 31 | 31 |
</parent>
|
| 32 | 32 |
|
| 33 | 33 |
<artifactId>server-runner</artifactId>
|
| ... | ... | @@ -27,7 +27,7 @@ |
| 27 | 27 |
<parent>
|
| 28 | 28 |
<groupId>fr.ird.observe</groupId>
|
| 29 | 29 |
<artifactId>ird-observe</artifactId>
|
| 30 |
- <version>7.0.6</version>
|
|
| 30 |
+ <version>7.0.7</version>
|
|
| 31 | 31 |
</parent>
|
| 32 | 32 |
|
| 33 | 33 |
<artifactId>services-client</artifactId>
|
| ... | ... | @@ -27,7 +27,7 @@ |
| 27 | 27 |
<parent>
|
| 28 | 28 |
<groupId>fr.ird.observe</groupId>
|
| 29 | 29 |
<artifactId>ird-observe</artifactId>
|
| 30 |
- <version>7.0.6</version>
|
|
| 30 |
+ <version>7.0.7</version>
|
|
| 31 | 31 |
</parent>
|
| 32 | 32 |
|
| 33 | 33 |
<artifactId>services-local</artifactId>
|
| ... | ... | @@ -23,6 +23,9 @@ package fr.ird.observe.services.local.service.actions.synchro.referential.sql; |
| 23 | 23 |
*/
|
| 24 | 24 |
|
| 25 | 25 |
import com.google.common.collect.ImmutableList;
|
| 26 |
+import fr.ird.observe.entities.referentiel.ObserveReferentialEntity;
|
|
| 27 |
+import fr.ird.observe.persistence.ObserveEntityEnum;
|
|
| 28 |
+import org.nuiton.topia.persistence.TopiaEntity;
|
|
| 26 | 29 |
import org.nuiton.topia.persistence.metadata.TopiaMetadataAssociation;
|
| 27 | 30 |
import org.nuiton.topia.persistence.metadata.TopiaMetadataEntity;
|
| 28 | 31 |
import org.nuiton.topia.persistence.metadata.TopiaMetadataModel;
|
| ... | ... | @@ -42,11 +45,13 @@ import java.util.Set; |
| 42 | 45 |
public class DeleteSqlStatementGenerator {
|
| 43 | 46 |
|
| 44 | 47 |
private final Set<TopiaMetadataAssociation> associations;
|
| 48 |
+ private final Set<TopiaMetadataAssociation> reverseAssociations;
|
|
| 45 | 49 |
private final TopiaMetadataEntity metadataEntity;
|
| 46 | 50 |
|
| 47 | 51 |
public DeleteSqlStatementGenerator(TopiaMetadataModel topiaMetadataModel, TopiaMetadataEntity metadataEntity) {
|
| 48 | 52 |
this.metadataEntity = Objects.requireNonNull(metadataEntity);
|
| 49 |
- this.associations = topiaMetadataModel.getReverseAssociations(metadataEntity);
|
|
| 53 |
+ this.associations = topiaMetadataModel.getAssociations(metadataEntity);
|
|
| 54 |
+ this.reverseAssociations = topiaMetadataModel.getReverseAssociations(metadataEntity);
|
|
| 50 | 55 |
}
|
| 51 | 56 |
|
| 52 | 57 |
public List<String> generateSql(String id) {
|
| ... | ... | @@ -54,9 +59,19 @@ public class DeleteSqlStatementGenerator { |
| 54 | 59 |
String sql = TopiaSqlStatements.generateDeleteStatement(metadataEntity, id);
|
| 55 | 60 |
result.add(sql);
|
| 56 | 61 |
for (TopiaMetadataAssociation association : associations) {
|
| 57 |
- String sql2 = TopiaSqlStatements.generateAssociationDeleteStatement(association, id);
|
|
| 62 |
+ String sql2 = TopiaSqlStatements.generateManyToManyAssociationDeleteStatement(association, id);
|
|
| 58 | 63 |
result.add(TopiaSqlStatements.boxAssociationStatement(sql2));
|
| 59 | 64 |
}
|
| 65 |
+ for (TopiaMetadataAssociation association : reverseAssociations) {
|
|
| 66 |
+ Class<? extends TopiaEntity> entityType = ObserveEntityEnum.valueOf(association.getOwner().getType()).getContract();
|
|
| 67 |
+ if (ObserveReferentialEntity.class.isAssignableFrom(entityType)) {
|
|
| 68 |
+ // always delete referential associations
|
|
| 69 |
+ // this is the opposite of https://gitlab.com/ultreiaio/ird-observe/issues/1065
|
|
| 70 |
+ // See https://gitlab.com/ultreiaio/ird-observe/issues/11270
|
|
| 71 |
+ String sql2 = TopiaSqlStatements.generateAssociationDeleteStatement(association, id);
|
|
| 72 |
+ result.add(TopiaSqlStatements.boxAssociationStatement(sql2));
|
|
| 73 |
+ }
|
|
| 74 |
+ }
|
|
| 60 | 75 |
return result.build();
|
| 61 | 76 |
}
|
| 62 | 77 |
|
| ... | ... | @@ -27,7 +27,7 @@ |
| 27 | 27 |
<parent>
|
| 28 | 28 |
<groupId>fr.ird.observe</groupId>
|
| 29 | 29 |
<artifactId>ird-observe</artifactId>
|
| 30 |
- <version>7.0.6</version>
|
|
| 30 |
+ <version>7.0.7</version>
|
|
| 31 | 31 |
</parent>
|
| 32 | 32 |
|
| 33 | 33 |
<artifactId>services</artifactId>
|
| ... | ... | @@ -26,7 +26,7 @@ |
| 26 | 26 |
<parent>
|
| 27 | 27 |
<groupId>fr.ird.observe</groupId>
|
| 28 | 28 |
<artifactId>ird-observe</artifactId>
|
| 29 |
- <version>7.0.6</version>
|
|
| 29 |
+ <version>7.0.7</version>
|
|
| 30 | 30 |
</parent>
|
| 31 | 31 |
|
| 32 | 32 |
<artifactId>test</artifactId>
|
| ... | ... | @@ -26,7 +26,7 @@ |
| 26 | 26 |
<parent>
|
| 27 | 27 |
<groupId>fr.ird.observe</groupId>
|
| 28 | 28 |
<artifactId>ird-observe</artifactId>
|
| 29 |
- <version>7.0.6</version>
|
|
| 29 |
+ <version>7.0.7</version>
|
|
| 30 | 30 |
</parent>
|
| 31 | 31 |
|
| 32 | 32 |
<artifactId>validation</artifactId>
|