Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe Commits: 82a198c5 by Tony CHEMIT at 2018-04-23T10:07:46Z Corriger certaines entrées de ObjectMaterial - See #928 - - - - - 9 changed files: - + persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_7_2.java - + persistence/src/main/resources/db/migration/7.2/01_update_dcp-common.sql - pom.xml - services-local/src/main/java/fr/ird/observe/services/local/service/data/seine/FloatingObjectServiceLocal.java - + test/src/main/resources/db/7.2/dataForTestLongline.sql.gz - + test/src/main/resources/db/7.2/dataForTestSeine.sql.gz - + test/src/main/resources/db/7.2/empty_h2.sql.gz - + test/src/main/resources/db/7.2/empty_pg.sql.gz - + test/src/main/resources/db/7.2/referentiel.sql.gz Changes: ===================================== persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_7_2.java ===================================== --- /dev/null +++ b/persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_7_2.java @@ -0,0 +1,66 @@ +package fr.ird.observe.persistence.migration; + +/*- + * #%L + * ObServe :: Persistence + * %% + * Copyright (C) 2008 - 2018 IRD, Code Lutin, Ultreia.io + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import org.nuiton.topia.persistence.support.TopiaSqlSupport; + +import java.util.List; + +/** + * Created on 27/10/16. + * + * @author Tony Chemit - dev@tchemit.fr + * @since 6.0 + */ +@MigrationVersion(version = "7.2") +public class DataSourceMigrationForVersion_7_2 extends AbstractObserveMigrationCallBack { + + DataSourceMigrationForVersion_7_2(AbstractDataSourceMigration callBack, String scriptSuffix) { + super(DataSourceMigrationForVersion_7_2.class, callBack, scriptSuffix); + } + + @Override + protected void prepareMigrationScript(TopiaSqlSupport topiaSqlSupport, List<String> queries, boolean showSql, boolean showProgression) { + + addScript("01", "update_dcp", queries); + + } + + public static class H2DataSourceMigrationForVersion extends DataSourceMigrationForVersion_7_2 { + + public H2DataSourceMigrationForVersion(AbstractDataSourceMigration callBack) { + super(callBack, H2DataSourceMigration.TYPE); + } + + } + + public static class PGDataSourceMigrationForVersion extends DataSourceMigrationForVersion_7_2 { + + public PGDataSourceMigrationForVersion(AbstractDataSourceMigration callBack) { + super(callBack, PGDataSourceMigration.TYPE); + } + + } + +} + ===================================== persistence/src/main/resources/db/migration/7.2/01_update_dcp-common.sql ===================================== --- /dev/null +++ b/persistence/src/main/resources/db/migration/7.2/01_update_dcp-common.sql @@ -0,0 +1 @@ +update observe_seine.objectmaterial set parent ='fr.ird.observe.entities.referentiel.seine.ObjectMaterial#0#0.2', topiaversion = topiaversion + 1 where topiaid='fr.ird.observe.entities.referentiel.seine.ObjectMaterial#0#0.4' \ No newline at end of file ===================================== pom.xml ===================================== --- a/pom.xml +++ b/pom.xml @@ -146,7 +146,7 @@ <devMode>true</devMode> <!--persistence model version--> - <observe.model.version>7.1</observe.model.version> + <observe.model.version>7.2</observe.model.version> <!-- build timestamp configuration --> <maven.build.timestamp.format>dd/MM/yyyy HH:mm z</maven.build.timestamp.format> ===================================== services-local/src/main/java/fr/ird/observe/services/local/service/data/seine/FloatingObjectServiceLocal.java ===================================== --- a/services-local/src/main/java/fr/ird/observe/services/local/service/data/seine/FloatingObjectServiceLocal.java +++ b/services-local/src/main/java/fr/ird/observe/services/local/service/data/seine/FloatingObjectServiceLocal.java @@ -71,6 +71,7 @@ public class FloatingObjectServiceLocal extends ObserveServiceLocal implements F public List<ObjectMaterialHierarchyDto> getObjectMaterialHierarchy() { ObjectMaterialTopiaDao dao = getTopiaPersistenceContext().getObjectMaterialDao(); List<ObjectMaterial> objectMaterials = dao.findAll(); + objectMaterials.sort(Comparator.comparing(ObjectMaterial::getCode)); return getObjectMaterialHierarchyDtos(objectMaterials); } ===================================== test/src/main/resources/db/7.2/dataForTestLongline.sql.gz ===================================== Binary files /dev/null and b/test/src/main/resources/db/7.2/dataForTestLongline.sql.gz differ ===================================== test/src/main/resources/db/7.2/dataForTestSeine.sql.gz ===================================== Binary files /dev/null and b/test/src/main/resources/db/7.2/dataForTestSeine.sql.gz differ ===================================== test/src/main/resources/db/7.2/empty_h2.sql.gz ===================================== Binary files /dev/null and b/test/src/main/resources/db/7.2/empty_h2.sql.gz differ ===================================== test/src/main/resources/db/7.2/empty_pg.sql.gz ===================================== Binary files /dev/null and b/test/src/main/resources/db/7.2/empty_pg.sql.gz differ ===================================== test/src/main/resources/db/7.2/referentiel.sql.gz ===================================== Binary files /dev/null and b/test/src/main/resources/db/7.2/referentiel.sql.gz differ View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/82a198c5acaff2c1b68c321529b8... --- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/82a198c5acaff2c1b68c321529b8... You're receiving this email because of your account on gitlab.com.