Commit 720979c3 authored by LAVENIER's avatar LAVENIER
Browse files

Merge branch 'release/1.10.2'

parents 5bd51778 99547afb
......@@ -3,7 +3,7 @@
<groupId>net.sumaris</groupId>
<artifactId>sumaris-pod</artifactId>
<version>1.10.1</version>
<version>1.10.2</version>
<packaging>pom</packaging>
<name>SUMARiS</name>
<description>SUMARiS :: Maven parent</description>
......
Subproject commit 30fdc5272d3244cb244166f70e24c5f2904f86d2
Subproject commit 88f496e152bbb813317a8ee7bc2220714457c200
......@@ -5,7 +5,7 @@
<parent>
<groupId>net.sumaris</groupId>
<artifactId>sumaris-pod</artifactId>
<version>1.10.1</version>
<version>1.10.2</version>
</parent>
<artifactId>sumaris-core-extraction</artifactId>
......
......@@ -3,7 +3,7 @@
<parent>
<artifactId>sumaris-pod</artifactId>
<groupId>net.sumaris</groupId>
<version>1.10.1</version>
<version>1.10.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -3,7 +3,7 @@
<parent>
<artifactId>sumaris-pod</artifactId>
<groupId>net.sumaris</groupId>
<version>1.10.1</version>
<version>1.10.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -4,7 +4,7 @@
<parent>
<groupId>net.sumaris</groupId>
<artifactId>sumaris-pod</artifactId>
<version>1.10.1</version>
<version>1.10.2</version>
</parent>
<artifactId>sumaris-core-shared</artifactId>
......
......@@ -25,6 +25,7 @@ package net.sumaris.core.dao.technical.model.annotation;
import com.google.common.collect.Lists;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import net.sumaris.core.config.SumarisConfiguration;
import net.sumaris.core.util.Beans;
import net.sumaris.core.util.StringUtils;
......@@ -32,13 +33,14 @@ import org.nuiton.config.ConfigOptionDef;
import org.reflections.Reflections;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* Helper class for enumerations
*/
@Slf4j
public final class EntityEnums {
private static final String MODEL_PACKAGE_NAME = "net.sumaris.core.model";
......@@ -50,7 +52,16 @@ public final class EntityEnums {
public static Set<Class<?>> getEntityEnumClasses(SumarisConfiguration config) {
// Add annotations entities
Reflections reflections = (config != null && config.isProduction() ? Reflections.collect() : new Reflections(MODEL_PACKAGE_NAME));
Reflections reflections = null;
// Try to use saved reflexions file from classpath
if (config != null && config.isProduction()) {
reflections = Reflections.collect();
if (reflections == null) {
log.warn("Reflections.collect() in production mode returned null. Fallback to default scanner");
}
}
// Or use reflexions scanner
reflections = Optional.ofNullable(reflections).orElse(new Reflections(MODEL_PACKAGE_NAME));
return reflections.getTypesAnnotatedWith(EntityEnum.class);
}
......
......@@ -4,7 +4,7 @@
<parent>
<groupId>net.sumaris</groupId>
<artifactId>sumaris-pod</artifactId>
<version>1.10.1</version>
<version>1.10.2</version>
</parent>
<artifactId>sumaris-core</artifactId>
......@@ -240,7 +240,7 @@
<goal>regex-property</goal>
</goals>
<configuration>
<value>${project.build.directory}/generated-sources/resources</value>
<value>${project.build.directory}/classes</value>
<regex>\\</regex>
<replacement>/</replacement>
<name>escapedOutputDirectory</name>
......@@ -263,7 +263,7 @@
<executions>
<execution>
<id>generate-reflections-xml</id>
<phase>generate-resources</phase>
<phase>process-classes</phase>
<goals>
<goal>execute</goal>
</goals>
......
......@@ -31,7 +31,8 @@ import java.util.Arrays;
public enum FractionEnum implements Serializable {
UNKNOWN(0, "UNK"),
ALL(1, "ALL")
ALL(1, "ALL"),
INDIVIDUAL(2, "INDIV")
;
public static FractionEnum valueOf(final int id) {
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
~ #%L
~ SUMARiS
~ %%
~ Copyright (C) 2019 SUMARiS Consortium
~ %%
~ 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%
-->
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"
logicalFilePath="https://github.com/sumaris-net/sumaris-pod/blob/master/sumaris-core/src/main/resources/net/sumaris/core/db/changelog/hsqldb/all/db-changelog-1.10.2.xml">
<property name="sqlCheck.not_empty.sql" value="SELECT COUNT(*) FROM STATUS WHERE ID=1"/>
<property name="sqlCheck.not_empty.expectedResult" value="1"/>
<!-- rename some properties -->
<changeSet id="benoit.lavenier@e-is.pro" author="1625816880600-301">
<preConditions onFail="MARK_RAN">
<and>
<sqlCheck expectedResult="${sqlCheck.not_empty.expectedResult}">${sqlCheck.not_empty.sql}</sqlCheck>
</and>
</preConditions>
<sql endDelimiter=";">
update software_properties set label='sumaris.enumeration.TaxonomicLevel.FAMILY.id' where label='sumaris.enumeration.taxonomicLevel.FAMILY.id';
update software_properties set label='sumaris.enumeration.TaxonomicLevel.SUBSPECIES.id' where label='sumaris.enumeration.taxonomicLevel.SUBSPECIES.id';
update software_properties set label='sumaris.enumeration.TaxonomicLevel.GENUS.id' where label='sumaris.enumeration.taxonomicLevel.GENUS.id';
update software_properties set label='sumaris.enumeration.LocationLevel.AUCTION.id' where label='sumaris.enumeration.locationLevel.AUCTION.id';
update software_properties set label='sumaris.enumeration.LocationLevel.HARBOUR.id' where label='sumaris.enumeration.locationLevel.HARBOUR.id';
update software_properties set label='sumaris.enumeration.LocationLevel.COUNTRY.id' where label='sumaris.enumeration.locationLevel.COUNTRY.id';
update software_properties set label='sumaris.enumeration.Pmfm.AGE.id' where label='sumaris.enumeration.pmfm.AGE.id';
update software_properties set label='sumaris.enumeration.Pmfm.SEX.id' where label='sumaris.enumeration.pmfm.SEX.id';
update software_properties set label='sumaris.enumeration.Pmfm.TAG_ID.id' where label='sumaris.enumeration.pmfm.TAG_ID.id';
update software_properties set label='sumaris.enumeration.Pmfm.STRATEGY_LABEL.id' where label='sumaris.enumeration.pmfm.STRATEGY_LABEL.id';
commit;
</sql>
</changeSet>
</databaseChangeLog>
......@@ -113,11 +113,11 @@
<!-- update SYSTEM_VERSION -->
<changeSet author="benoit.lavenier@e-is.pro" id="1625816880596-200" runOnChange="true">
<delete tableName="SYSTEM_VERSION">
<where>LABEL='1.9.0'</where>
<where>LABEL in ('1.9.0', '1.10.0')</where>
</delete>
<insert tableName="SYSTEM_VERSION">
<column name="ID" valueComputed="NEXT VALUE FOR SYSTEM_VERSION_SEQ"/>
<column name="LABEL">1.9.0</column>
<column name="LABEL">1.10.0</column>
<column name="DESCRIPTION">
- BATCH: Add column SUBGROUP_COUNT
- Add table EXPECTED_SALE and add relations on SALE_MEASUREMENT and PRODUCT
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
~ #%L
~ SUMARiS
~ %%
~ Copyright (C) 2019 SUMARiS Consortium
~ %%
~ 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%
-->
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"
logicalFilePath="https://github.com/sumaris-net/sumaris-pod/blob/master/sumaris-core/src/main/resources/net/sumaris/core/db/changelog/hsqldb/db-changelog-1.10.2.xml">
<property name="sqlCheck.not_empty.sql" value="SELECT COUNT(*) FROM STATUS WHERE ID=1"/>
<property name="sqlCheck.not_empty.expectedResult" value="1"/>
<!-- update SYSTEM_VERSION -->
<changeSet author="benoit.lavenier@e-is.pro" id="1625816880600-200" runOnChange="true">
<delete tableName="SYSTEM_VERSION">
<where>LABEL='1.10.2'</where>
</delete>
<insert tableName="SYSTEM_VERSION">
<column name="ID" valueComputed="NEXT VALUE FOR SYSTEM_VERSION_SEQ"/>
<column name="LABEL">1.10.2</column>
<column name="DESCRIPTION">
- Fix enumeration key, in SOFTWARE_PROPERTY lines
</column>
<column name="CREATION_DATE" valueComputed="sysdate"/>
<column name="UPDATE_DATE" valueComputed="current_timestamp"/>
<column name="COMMENTS">
</column>
</insert>
</changeSet>
</databaseChangeLog>
......@@ -105,6 +105,9 @@
<include relativeToChangelogFile="true" file="db-changelog-1.10.0.xml"/>
<include relativeToChangelogFile="true" file="all/db-changelog-1.10.0.xml"/>
<include relativeToChangelogFile="true" file="db-changelog-1.10.2.xml"/>
<include relativeToChangelogFile="true" file="all/db-changelog-1.10.2.xml"/>
<!-- Refresh schema objects (functions, procedures, triggers, ...) -->
<include relativeToChangelogFile="true" file="db-changelog-refresh.xml"/>
......
......@@ -4,7 +4,7 @@
<parent>
<groupId>net.sumaris</groupId>
<artifactId>sumaris-pod</artifactId>
<version>1.10.1</version>
<version>1.10.2</version>
</parent>
<artifactId>sumaris-server</artifactId>
......
......@@ -4,7 +4,7 @@
<parent>
<groupId>net.sumaris</groupId>
<artifactId>sumaris-pod</artifactId>
<version>1.10.1</version>
<version>1.10.2</version>
</parent>
<artifactId>sumaris-test-shared</artifactId>
......
......@@ -69,7 +69,7 @@
<SOFTWARE_PROPERTY ID="74" STATUS_FK="1" SOFTWARE_FK="4" CREATION_DATE="2019-02-11" LABEL="sumaris.favicon" NAME="image:22"/>
<SOFTWARE_PROPERTY ID="75" STATUS_FK="1" SOFTWARE_FK="4" CREATION_DATE="2019-02-11" LABEL="sumaris.defaultLocale" NAME="en"/>
<SOFTWARE_PROPERTY ID="76" STATUS_FK="1" SOFTWARE_FK="4" CREATION_DATE="2019-02-11" LABEL="sumaris.observedLocation.enable" NAME="true"/>
<SOFTWARE_PROPERTY ID="77" STATUS_FK="1" SOFTWARE_FK="4" CREATION_DATE="2019-02-11" LABEL="sumaris.observedLocation.name" NAME="Observations"/>
<SOFTWARE_PROPERTY ID="77" STATUS_FK="1" SOFTWARE_FK="4" CREATION_DATE="2019-02-11" LABEL="sumaris.observedLocation.name" NAME="MENU.OCCASIONS"/>
<SOFTWARE_PROPERTY ID="78" STATUS_FK="1" SOFTWARE_FK="4" CREATION_DATE="2019-02-11" LABEL="sumaris.trip.enable" NAME="true"/>
<SOFTWARE_PROPERTY ID="79" STATUS_FK="1" SOFTWARE_FK="4" CREATION_DATE="2019-02-11" LABEL="sumaris.vessel.status.default" NAME="2"/>
<SOFTWARE_PROPERTY ID="80" STATUS_FK="1" SOFTWARE_FK="4" CREATION_DATE="2019-02-11" LABEL="sumaris.android.install.url" NAME="./download/android/sumaris-app-latest.apk"/>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment