Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
8 changed files:
- dto/pom.xml
- persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_7_2.java
- + persistence/src/main/resources/db/migration/7.2/06_fix_species_group_release_mode_for_cetaceans-common.sql
- services-local/src/test/java/fr/ird/observe/services/local/service/actions/validate/ValidateServiceLocalTest.java
- test/src/main/java/fr/ird/observe/test/ObserveFixtures.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/referentiel.sql.gz
Changes:
| ... | ... | @@ -70,10 +70,6 @@ |
| 70 | 70 |
</dependency>
|
| 71 | 71 |
<dependency>
|
| 72 | 72 |
<groupId>io.ultreia.java4all.jaxx</groupId>
|
| 73 |
- <artifactId>jaxx-runtime</artifactId>
|
|
| 74 |
- </dependency>
|
|
| 75 |
- <dependency>
|
|
| 76 |
- <groupId>io.ultreia.java4all.jaxx</groupId>
|
|
| 77 | 73 |
<artifactId>jaxx-widgets-select</artifactId>
|
| 78 | 74 |
</dependency>
|
| 79 | 75 |
|
| ... | ... | @@ -22,8 +22,13 @@ package fr.ird.observe.persistence.migration; |
| 22 | 22 |
* #L%
|
| 23 | 23 |
*/
|
| 24 | 24 |
|
| 25 |
+import org.nuiton.topia.persistence.support.TopiaSqlQuery;
|
|
| 25 | 26 |
import org.nuiton.topia.persistence.support.TopiaSqlSupport;
|
| 26 | 27 |
|
| 28 |
+import java.sql.Connection;
|
|
| 29 |
+import java.sql.PreparedStatement;
|
|
| 30 |
+import java.sql.ResultSet;
|
|
| 31 |
+import java.sql.SQLException;
|
|
| 27 | 32 |
import java.util.List;
|
| 28 | 33 |
|
| 29 | 34 |
/**
|
| ... | ... | @@ -48,6 +53,21 @@ public class DataSourceMigrationForVersion_7_2 extends AbstractObserveMigrationC |
| 48 | 53 |
addScript("04", "update_non_target_catch_release_status", queries);
|
| 49 | 54 |
addScript("05", "remove_species_group_release_mode_value", queries);
|
| 50 | 55 |
|
| 56 |
+ Boolean withIds = topiaSqlSupport.findSingleResult(new TopiaSqlQuery<Boolean>() {
|
|
| 57 |
+ @Override
|
|
| 58 |
+ public PreparedStatement prepareQuery(Connection connection) throws SQLException {
|
|
| 59 |
+ return connection.prepareStatement("SELECT COUNT (*) FROM observe_common.SpeciesGroup WHERE topiaid='fr.ird.observe.entities.referentiel.SpeciesGroup#1239832683690#0.9204972827240977';");
|
|
| 60 |
+ }
|
|
| 61 |
+ |
|
| 62 |
+ @Override
|
|
| 63 |
+ public Boolean prepareResult(ResultSet resultSet) throws SQLException {
|
|
| 64 |
+ return resultSet.getInt(1) > 0;
|
|
| 65 |
+ }
|
|
| 66 |
+ });
|
|
| 67 |
+ if (withIds) {
|
|
| 68 |
+ addScript("06", "fix_species_group_release_mode_for_cetaceans", queries);
|
|
| 69 |
+ }
|
|
| 70 |
+ |
|
| 51 | 71 |
}
|
| 52 | 72 |
|
| 53 | 73 |
public static class H2DataSourceMigrationForVersion extends DataSourceMigrationForVersion_7_2 {
|
| 1 |
+---
|
|
| 2 |
+-- #%L
|
|
| 3 |
+-- ObServe :: Persistence
|
|
| 4 |
+-- %%
|
|
| 5 |
+-- Copyright (C) 2008 - 2018 IRD, Code Lutin, Ultreia.io
|
|
| 6 |
+-- %%
|
|
| 7 |
+-- This program is free software: you can redistribute it and/or modify
|
|
| 8 |
+-- it under the terms of the GNU General Public License as
|
|
| 9 |
+-- published by the Free Software Foundation, either version 3 of the
|
|
| 10 |
+-- License, or (at your option) any later version.
|
|
| 11 |
+--
|
|
| 12 |
+-- This program is distributed in the hope that it will be useful,
|
|
| 13 |
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
| 14 |
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
| 15 |
+-- GNU General Public License for more details.
|
|
| 16 |
+--
|
|
| 17 |
+-- You should have received a copy of the GNU General Public
|
|
| 18 |
+-- License along with this program. If not, see
|
|
| 19 |
+-- <http://www.gnu.org/licenses/gpl-3.0.html>.
|
|
| 20 |
+-- #L%
|
|
| 21 |
+---
|
|
| 22 |
+ |
|
| 23 |
+INSERT INTO observe_common.SpeciesGroup_SpeciesGroupReleaseMode(SpeciesGroup, SpeciesGroupReleaseMode) VALUES ('fr.ird.observe.entities.referentiel.SpeciesGroup#1239832683690#0.9204972827240977','fr.ird.observe.entities.referentiel.SpeciesGroupReleaseMode#0#1');;
|
|
| 24 |
+INSERT INTO observe_common.SpeciesGroup_SpeciesGroupReleaseMode(SpeciesGroup, SpeciesGroupReleaseMode) VALUES('fr.ird.observe.entities.referentiel.SpeciesGroup#1239832683690#0.9204972827240977','fr.ird.observe.entities.referentiel.SpeciesGroupReleaseMode#0#7');
|
|
| 25 |
+INSERT INTO observe_common.SpeciesGroup_SpeciesGroupReleaseMode(SpeciesGroup, SpeciesGroupReleaseMode) VALUES('fr.ird.observe.entities.referentiel.SpeciesGroup#1239832683690#0.9204972827240977','fr.ird.observe.entities.referentiel.SpeciesGroupReleaseMode#0#8');
|
|
| 26 |
+ |
| ... | ... | @@ -148,7 +148,7 @@ public class ValidateServiceLocalTest extends ServiceLocalTestSupport { |
| 148 | 148 |
Assert.assertEquals(DtoModelClasses.REFERENTIAL_TYPES.size() - 1, types.size());
|
| 149 | 149 |
|
| 150 | 150 |
assertValidateResult(result, DataQualityDto.class, 1);
|
| 151 |
- assertValidateResult(result, SpeciesGroupReleaseModeDto.class, 3);
|
|
| 151 |
+ assertValidateResult(result, SpeciesGroupReleaseModeDto.class, 2);
|
|
| 152 | 152 |
assertValidateResult(result, SettingShapeDto.class, 3);
|
| 153 | 153 |
assertValidateResult(result, BaitHaulingStatusDto.class, 3);
|
| 154 | 154 |
assertValidateResult(result, TripTypeDto.class, 1);
|
| ... | ... | @@ -102,7 +102,7 @@ public class ObserveFixtures { |
| 102 | 102 |
.put("observe_common.species", 285L)
|
| 103 | 103 |
.put("observe_common.species_specieslist", 401L)
|
| 104 | 104 |
.put("observe_common.speciesgroup", 11L)
|
| 105 |
- .put("observe_common.speciesgroupreleasemode", 10L)
|
|
| 105 |
+ .put("observe_common.speciesgroupreleasemode", 9L)
|
|
| 106 | 106 |
.put("observe_common.specieslist", 6L)
|
| 107 | 107 |
.put("observe_common.vessel", 1172L)
|
| 108 | 108 |
.put("observe_common.vesselsizecategory", 13L)
|
No preview for this file type
No preview for this file type
No preview for this file type