branch develop updated (24614be9 -> 4cc27889)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository echobase. See https://gitlab.nuiton.org/codelutin/echobase.git from 24614be9 Update postgres version to avoid missing am.amcanorder column bug on postgres server >=9.6 new 4cc27889 fixes #9687 : La suppression d'un voyage/transit/transect ne fonctionne pas. The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit 4cc27889e140b2681cb8e3673af6e339d5437c2c Author: Jean Couteau <jean.couteau@gmail.com> Date: Thu Mar 15 09:37:33 2018 +0100 fixes #9687 : La suppression d'un voyage/transit/transect ne fonctionne pas. Force la suppression des transit et transect pour que ça fonctionne sur PG Summary of changes: .../strategy/CommonAllRemoveDataStrategy.java | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository echobase. See https://gitlab.nuiton.org/codelutin/echobase.git commit 4cc27889e140b2681cb8e3673af6e339d5437c2c Author: Jean Couteau <jean.couteau@gmail.com> Date: Thu Mar 15 09:37:33 2018 +0100 fixes #9687 : La suppression d'un voyage/transit/transect ne fonctionne pas. Force la suppression des transit et transect pour que ça fonctionne sur PG --- .../strategy/CommonAllRemoveDataStrategy.java | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/removedata/strategy/CommonAllRemoveDataStrategy.java b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/removedata/strategy/CommonAllRemoveDataStrategy.java index 81783ef9..7992373a 100644 --- a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/removedata/strategy/CommonAllRemoveDataStrategy.java +++ b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/removedata/strategy/CommonAllRemoveDataStrategy.java @@ -24,6 +24,8 @@ package fr.ifremer.echobase.services.service.removedata.strategy; import com.google.common.collect.Sets; import fr.ifremer.echobase.entities.ImportLog; import fr.ifremer.echobase.entities.ImportType; +import fr.ifremer.echobase.entities.data.Transect; +import fr.ifremer.echobase.entities.data.Transit; import fr.ifremer.echobase.entities.data.Voyage; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -69,6 +71,8 @@ public class CommonAllRemoveDataStrategy extends AbstractRemoveDataStrategy<Voya @Override protected void removeImportData(DataAcousticProvider<Voyage> provider, String id) throws TopiaException { + Voyage voyage = provider.getEntity(); + if (id.startsWith(Voyage.class.getName())) { // get entity to delete @@ -80,6 +84,39 @@ public class CommonAllRemoveDataStrategy extends AbstractRemoveDataStrategy<Voya if (log.isDebugEnabled()) { log.debug(entity.getTopiaId() + " was removed"); } + } else if (id.startsWith(Transect.class.getName())) { + + // remove transect + Transect transect = persistenceService.getTransect(id); + + // remove it from transit + Transit transit = persistenceService.getTransitContainsTransect(transect); + transit.removeTransect(transect); + + // delete it + persistenceService.deleteTransect(transect); + + if (log.isDebugEnabled()) { + log.debug(transect.getTopiaId() + " was removed"); + } + + } else if (id.startsWith(Transit.class.getName())) { + + // remove transit + Transit transit = persistenceService.getTransit(id); + + // remove it from voyage + Voyage entity = persistenceService.getVoyage(voyage.getTopiaId()); + + entity.removeTransit(transit); + + // delete it + persistenceService.deleteTransit(transit); + + if (log.isDebugEnabled()) { + log.debug(transit.getTopiaId() + " was removed"); + } + } else { canNotDealWithId(id); } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm