Tony CHEMIT pushed to branch master-7.x at ultreiaio / ird-observe Commits: 89f1244e by tchemit at 2019-05-06T12:03:13Z [jgitflow-maven-plugin]updating poms for 7.0.7-SNAPSHOT development[skip ci] - - - - - 56293427 by tchemit at 2019-05-06T12:09:52Z [jgitflow-maven-plugin]updating develop poms to master versions to avoid merge conflicts[skip ci] - - - - - 923006e8 by tchemit at 2019-05-06T12:09:52Z [jgitflow-maven-plugin]merging 'master-7.x' into 'develop-7.x' - - - - - d1c0e65b by tchemit at 2019-05-06T12:09:53Z [jgitflow-maven-plugin]Updating develop poms back to pre merge state[skip ci] - - - - - 43c3f745 by tchemit at 2019-05-10T14:48:20Z update pom - - - - - 56f88bf2 by tchemit at 2019-05-13T11:42:54Z [SYNCHRO SIMPLE] Une requête DELETE échoue pour cause de violation de contrainte FK - Closes #1270 - - - - - 25874e1c by tchemit at 2019-05-13T18:14:48Z [jgitflow-maven-plugin]updating poms for branch'release/7.0.7' with non-snapshot versions[skip ci] - - - - - 83b59311 by tchemit at 2019-05-13T18:33:25Z [jgitflow-maven-plugin]merging 'release/7.0.7' into 'master-7.x' - - - - - 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: ===================================== client-configuration/pom.xml ===================================== @@ -26,7 +26,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>ird-observe</artifactId> - <version>7.0.6</version> + <version>7.0.7</version> </parent> <artifactId>client-configuration</artifactId> ===================================== client-core/pom.xml ===================================== @@ -26,7 +26,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>ird-observe</artifactId> - <version>7.0.6</version> + <version>7.0.7</version> </parent> <artifactId>client-core</artifactId> ===================================== client-runner/pom.xml ===================================== @@ -26,7 +26,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>ird-observe</artifactId> - <version>7.0.6</version> + <version>7.0.7</version> </parent> <artifactId>client-runner</artifactId> ===================================== dto/pom.xml ===================================== @@ -27,7 +27,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>ird-observe</artifactId> - <version>7.0.6</version> + <version>7.0.7</version> </parent> <artifactId>dto</artifactId> ===================================== observe-i18n/pom.xml ===================================== @@ -26,7 +26,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>ird-observe</artifactId> - <version>7.0.6</version> + <version>7.0.7</version> </parent> <artifactId>observe-i18n</artifactId> ===================================== observe/pom.xml ===================================== @@ -26,7 +26,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>ird-observe</artifactId> - <version>7.0.6</version> + <version>7.0.7</version> </parent> <artifactId>observe</artifactId> ===================================== persistence/pom.xml ===================================== @@ -26,7 +26,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>ird-observe</artifactId> - <version>7.0.6</version> + <version>7.0.7</version> </parent> <artifactId>persistence</artifactId> ===================================== pom.xml ===================================== @@ -26,12 +26,12 @@ <parent> <groupId>io.ultreia.maven</groupId> <artifactId>pom</artifactId> - <version>2019.8.15</version> + <version>2019.8.16</version> </parent> <groupId>fr.ird.observe</groupId> <artifactId>ird-observe</artifactId> - <version>7.0.6</version> + <version>7.0.7</version> <packaging>pom</packaging> <name>ObServe :: Pom</name> @@ -165,7 +165,7 @@ <lib.version.java4all.eugene>3.0-alpha-26</lib.version.java4all.eugene> <lib.version.java4all.jaxx>3.0-alpha-50</lib.version.java4all.jaxx> <!--<lib.version.java4all.i18n>4.0-beta-8-SNAPSHOT</lib.version.java4all.i18n>--> - <lib.version.java4all.topia>1.1.12</lib.version.java4all.topia> + <lib.version.java4all.topia>1.1.13</lib.version.java4all.topia> <!--<lib.version.nuiton.topia>3.6-SNAPSHOT</lib.version.nuiton.topia>--> <!--<lib.version.java4all.eugene>3.0-alpha-21</lib.version.java4all.eugene>--> ===================================== server-configuration/pom.xml ===================================== @@ -26,7 +26,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>ird-observe</artifactId> - <version>7.0.6</version> + <version>7.0.7</version> </parent> <artifactId>server-configuration</artifactId> ===================================== server-core/pom.xml ===================================== @@ -27,7 +27,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>ird-observe</artifactId> - <version>7.0.6</version> + <version>7.0.7</version> </parent> <artifactId>server-core</artifactId> ===================================== server-runner/pom.xml ===================================== @@ -27,7 +27,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>ird-observe</artifactId> - <version>7.0.6</version> + <version>7.0.7</version> </parent> <artifactId>server-runner</artifactId> ===================================== services-client/pom.xml ===================================== @@ -27,7 +27,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>ird-observe</artifactId> - <version>7.0.6</version> + <version>7.0.7</version> </parent> <artifactId>services-client</artifactId> ===================================== services-local/pom.xml ===================================== @@ -27,7 +27,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>ird-observe</artifactId> - <version>7.0.6</version> + <version>7.0.7</version> </parent> <artifactId>services-local</artifactId> ===================================== services-local/src/main/java/fr/ird/observe/services/local/service/actions/synchro/referential/sql/DeleteSqlStatementGenerator.java ===================================== @@ -23,6 +23,9 @@ package fr.ird.observe.services.local.service.actions.synchro.referential.sql; */ import com.google.common.collect.ImmutableList; +import fr.ird.observe.entities.referentiel.ObserveReferentialEntity; +import fr.ird.observe.persistence.ObserveEntityEnum; +import org.nuiton.topia.persistence.TopiaEntity; import org.nuiton.topia.persistence.metadata.TopiaMetadataAssociation; import org.nuiton.topia.persistence.metadata.TopiaMetadataEntity; import org.nuiton.topia.persistence.metadata.TopiaMetadataModel; @@ -42,11 +45,13 @@ import java.util.Set; public class DeleteSqlStatementGenerator { private final Set<TopiaMetadataAssociation> associations; + private final Set<TopiaMetadataAssociation> reverseAssociations; private final TopiaMetadataEntity metadataEntity; public DeleteSqlStatementGenerator(TopiaMetadataModel topiaMetadataModel, TopiaMetadataEntity metadataEntity) { this.metadataEntity = Objects.requireNonNull(metadataEntity); - this.associations = topiaMetadataModel.getReverseAssociations(metadataEntity); + this.associations = topiaMetadataModel.getAssociations(metadataEntity); + this.reverseAssociations = topiaMetadataModel.getReverseAssociations(metadataEntity); } public List<String> generateSql(String id) { @@ -54,9 +59,19 @@ public class DeleteSqlStatementGenerator { String sql = TopiaSqlStatements.generateDeleteStatement(metadataEntity, id); result.add(sql); for (TopiaMetadataAssociation association : associations) { - String sql2 = TopiaSqlStatements.generateAssociationDeleteStatement(association, id); + String sql2 = TopiaSqlStatements.generateManyToManyAssociationDeleteStatement(association, id); result.add(TopiaSqlStatements.boxAssociationStatement(sql2)); } + for (TopiaMetadataAssociation association : reverseAssociations) { + Class<? extends TopiaEntity> entityType = ObserveEntityEnum.valueOf(association.getOwner().getType()).getContract(); + if (ObserveReferentialEntity.class.isAssignableFrom(entityType)) { + // always delete referential associations + // this is the opposite of https://gitlab.com/ultreiaio/ird-observe/issues/1065 + // See https://gitlab.com/ultreiaio/ird-observe/issues/11270 + String sql2 = TopiaSqlStatements.generateAssociationDeleteStatement(association, id); + result.add(TopiaSqlStatements.boxAssociationStatement(sql2)); + } + } return result.build(); } ===================================== services/pom.xml ===================================== @@ -27,7 +27,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>ird-observe</artifactId> - <version>7.0.6</version> + <version>7.0.7</version> </parent> <artifactId>services</artifactId> ===================================== test/pom.xml ===================================== @@ -26,7 +26,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>ird-observe</artifactId> - <version>7.0.6</version> + <version>7.0.7</version> </parent> <artifactId>test</artifactId> ===================================== validation/pom.xml ===================================== @@ -26,7 +26,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>ird-observe</artifactId> - <version>7.0.6</version> + <version>7.0.7</version> </parent> <artifactId>validation</artifactId> View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/compare/d88e954191356187335149c5b8e... -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/compare/d88e954191356187335149c5b8e... You're receiving this email because of your account on gitlab.com.
participants (1)
-
Tony CHEMIT