branch develop updated (541900b -> 1869d03)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository observe. See https://gitlab.nuiton.org/codelutin/observe.git from 541900b Lors de la suppression d'un programme, l'UI propose des programmes qui ne sont pas du type de la marée (Fixes #8935) new 1869d03 Fix bad topia generation (Fixes #8934) 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 1869d0373b0fb956ac3df1655a13052017e11add Author: Tony CHEMIT <dev@tchemit.fr> Date: Tue Jan 10 11:26:00 2017 +0100 Fix bad topia generation (Fixes #8934) Summary of changes: .../entities/referentiel/SpeciesTopiaDao.java | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 persistence/src/main/java/fr/ird/observe/entities/referentiel/SpeciesTopiaDao.java -- 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 observe. See https://gitlab.nuiton.org/codelutin/observe.git commit 1869d0373b0fb956ac3df1655a13052017e11add Author: Tony CHEMIT <dev@tchemit.fr> Date: Tue Jan 10 11:26:00 2017 +0100 Fix bad topia generation (Fixes #8934) --- .../entities/referentiel/SpeciesTopiaDao.java | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/persistence/src/main/java/fr/ird/observe/entities/referentiel/SpeciesTopiaDao.java b/persistence/src/main/java/fr/ird/observe/entities/referentiel/SpeciesTopiaDao.java new file mode 100644 index 0000000..6e3427e --- /dev/null +++ b/persistence/src/main/java/fr/ird/observe/entities/referentiel/SpeciesTopiaDao.java @@ -0,0 +1,37 @@ +package fr.ird.observe.entities.referentiel; + +import fr.ird.observe.entities.longline.CatchLongline; +import fr.ird.observe.persistence.ObserveEntityEnum; +import org.hibernate.Session; +import org.nuiton.topia.persistence.internal.support.HibernateTopiaJpaSupport; +import org.nuiton.topia.persistence.support.TopiaHibernateSupport; + +import java.util.List; + +public class SpeciesTopiaDao extends AbstractSpeciesTopiaDao<Species> { + + @Override + public void delete(Species entity) { + + TopiaHibernateSupport hibernateSupport = ((HibernateTopiaJpaSupport) topiaJpaSupport).getHibernateSupport(); + Session hibernateSession = hibernateSupport.getHibernateSession(); + + //FIXME Cela devrait être généré dans Topia. + { + String sql = + "SELECT main.* FROM OBSERVE_LONGLINE.catch main, OBSERVE_LONGLINE.catch_predator secondary " + + " WHERE main.topiaId=secondary.catch AND secondary.predator='" + entity.getTopiaId() + "'"; + List<CatchLongline> list = hibernateSession + .createSQLQuery(sql) + .addEntity("main", ObserveEntityEnum.CatchLongline.getImplementation()) + .list(); + + for (CatchLongline item : list) { + item.removePredator(entity); + } + } + + super.delete(entity); + + } +} -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm