Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
-
82a198c5
by Tony CHEMIT at 2018-04-23T10:07:46Z
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:
| 1 |
+package fr.ird.observe.persistence.migration;
|
|
| 2 |
+ |
|
| 3 |
+/*-
|
|
| 4 |
+ * #%L
|
|
| 5 |
+ * ObServe :: Persistence
|
|
| 6 |
+ * %%
|
|
| 7 |
+ * Copyright (C) 2008 - 2018 IRD, Code Lutin, Ultreia.io
|
|
| 8 |
+ * %%
|
|
| 9 |
+ * This program is free software: you can redistribute it and/or modify
|
|
| 10 |
+ * it under the terms of the GNU General Public License as
|
|
| 11 |
+ * published by the Free Software Foundation, either version 3 of the
|
|
| 12 |
+ * License, or (at your option) any later version.
|
|
| 13 |
+ *
|
|
| 14 |
+ * This program is distributed in the hope that it will be useful,
|
|
| 15 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
| 16 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
| 17 |
+ * GNU General Public License for more details.
|
|
| 18 |
+ *
|
|
| 19 |
+ * You should have received a copy of the GNU General Public
|
|
| 20 |
+ * License along with this program. If not, see
|
|
| 21 |
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
|
|
| 22 |
+ * #L%
|
|
| 23 |
+ */
|
|
| 24 |
+ |
|
| 25 |
+import org.nuiton.topia.persistence.support.TopiaSqlSupport;
|
|
| 26 |
+ |
|
| 27 |
+import java.util.List;
|
|
| 28 |
+ |
|
| 29 |
+/**
|
|
| 30 |
+ * Created on 27/10/16.
|
|
| 31 |
+ *
|
|
| 32 |
+ * @author Tony Chemit - dev@tchemit.fr
|
|
| 33 |
+ * @since 6.0
|
|
| 34 |
+ */
|
|
| 35 |
+@MigrationVersion(version = "7.2")
|
|
| 36 |
+public class DataSourceMigrationForVersion_7_2 extends AbstractObserveMigrationCallBack {
|
|
| 37 |
+ |
|
| 38 |
+ DataSourceMigrationForVersion_7_2(AbstractDataSourceMigration callBack, String scriptSuffix) {
|
|
| 39 |
+ super(DataSourceMigrationForVersion_7_2.class, callBack, scriptSuffix);
|
|
| 40 |
+ }
|
|
| 41 |
+ |
|
| 42 |
+ @Override
|
|
| 43 |
+ protected void prepareMigrationScript(TopiaSqlSupport topiaSqlSupport, List<String> queries, boolean showSql, boolean showProgression) {
|
|
| 44 |
+ |
|
| 45 |
+ addScript("01", "update_dcp", queries);
|
|
| 46 |
+ |
|
| 47 |
+ }
|
|
| 48 |
+ |
|
| 49 |
+ public static class H2DataSourceMigrationForVersion extends DataSourceMigrationForVersion_7_2 {
|
|
| 50 |
+ |
|
| 51 |
+ public H2DataSourceMigrationForVersion(AbstractDataSourceMigration callBack) {
|
|
| 52 |
+ super(callBack, H2DataSourceMigration.TYPE);
|
|
| 53 |
+ }
|
|
| 54 |
+ |
|
| 55 |
+ }
|
|
| 56 |
+ |
|
| 57 |
+ public static class PGDataSourceMigrationForVersion extends DataSourceMigrationForVersion_7_2 {
|
|
| 58 |
+ |
|
| 59 |
+ public PGDataSourceMigrationForVersion(AbstractDataSourceMigration callBack) {
|
|
| 60 |
+ super(callBack, PGDataSourceMigration.TYPE);
|
|
| 61 |
+ }
|
|
| 62 |
+ |
|
| 63 |
+ }
|
|
| 64 |
+ |
|
| 65 |
+}
|
|
| 66 |
+ |
| 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 |
| ... | ... | @@ -146,7 +146,7 @@ |
| 146 | 146 |
<devMode>true</devMode>
|
| 147 | 147 |
|
| 148 | 148 |
<!--persistence model version-->
|
| 149 |
- <observe.model.version>7.1</observe.model.version>
|
|
| 149 |
+ <observe.model.version>7.2</observe.model.version>
|
|
| 150 | 150 |
|
| 151 | 151 |
<!-- build timestamp configuration -->
|
| 152 | 152 |
<maven.build.timestamp.format>dd/MM/yyyy HH:mm z</maven.build.timestamp.format>
|
| ... | ... | @@ -71,6 +71,7 @@ public class FloatingObjectServiceLocal extends ObserveServiceLocal implements F |
| 71 | 71 |
public List<ObjectMaterialHierarchyDto> getObjectMaterialHierarchy() {
|
| 72 | 72 |
ObjectMaterialTopiaDao dao = getTopiaPersistenceContext().getObjectMaterialDao();
|
| 73 | 73 |
List<ObjectMaterial> objectMaterials = dao.findAll();
|
| 74 |
+ objectMaterials.sort(Comparator.comparing(ObjectMaterial::getCode));
|
|
| 74 | 75 |
return getObjectMaterialHierarchyDtos(objectMaterials);
|
| 75 | 76 |
}
|
| 76 | 77 |
|
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type