Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe Commits: 69c33e34 by Tony Chemit at 2024-03-05T16:20:51+01:00 toolkit-templates - vérification que la tag-value digits est bien définie pour tout attribute de type décimal sur le modèle de persistance - - - - - bee7fdae by Tony Chemit at 2024-03-05T16:20:54+01:00 model - Remplissages de la tag-value digits manquante - - - - - 330e1682 by Tony Chemit at 2024-03-05T16:20:58+01:00 persistence - Mise à jour des descripteurs d'entités - - - - - 895a9697 by Tony Chemit at 2024-03-05T16:23:06+01:00 Merge branch 'feature/issue-2844' into develop Consolidation du modèle de persistence sur les données de type décimales - Closes #2844 - - - - - 24 changed files: - core/persistence/java/src/main/resources/fr/ird/observe/entities/data/ll/landing/LandingPartImpl.hbm.xml - core/persistence/java/src/main/resources/fr/ird/observe/entities/data/ll/logbook/ActivityImpl.hbm.xml - core/persistence/java/src/main/resources/fr/ird/observe/entities/data/ll/logbook/BaitsCompositionImpl.hbm.xml - core/persistence/java/src/main/resources/fr/ird/observe/entities/data/ll/logbook/BranchlinesCompositionImpl.hbm.xml - core/persistence/java/src/main/resources/fr/ird/observe/entities/data/ll/logbook/CatchImpl.hbm.xml - core/persistence/java/src/main/resources/fr/ird/observe/entities/data/ll/logbook/FloatlinesCompositionImpl.hbm.xml - core/persistence/java/src/main/resources/fr/ird/observe/entities/data/ll/logbook/SamplePartImpl.hbm.xml - core/persistence/java/src/main/resources/fr/ird/observe/entities/data/ll/logbook/SetImpl.hbm.xml - core/persistence/java/src/main/resources/fr/ird/observe/entities/data/ll/observation/BaitsCompositionImpl.hbm.xml - core/persistence/java/src/main/resources/fr/ird/observe/entities/data/ll/observation/BasketImpl.hbm.xml - core/persistence/java/src/main/resources/fr/ird/observe/entities/data/ll/observation/BranchlineImpl.hbm.xml - core/persistence/java/src/main/resources/fr/ird/observe/entities/data/ll/observation/BranchlinesCompositionImpl.hbm.xml - core/persistence/java/src/main/resources/fr/ird/observe/entities/data/ll/observation/CatchImpl.hbm.xml - core/persistence/java/src/main/resources/fr/ird/observe/entities/data/ll/observation/EncounterImpl.hbm.xml - core/persistence/java/src/main/resources/fr/ird/observe/entities/data/ll/observation/FloatlinesCompositionImpl.hbm.xml - core/persistence/java/src/main/resources/fr/ird/observe/entities/data/ll/observation/SetImpl.hbm.xml - core/persistence/java/src/main/resources/fr/ird/observe/entities/data/ll/observation/SizeMeasureImpl.hbm.xml - core/persistence/java/src/main/resources/fr/ird/observe/entities/data/ll/observation/TdrImpl.hbm.xml - core/persistence/java/src/main/resources/fr/ird/observe/entities/data/ll/observation/WeightMeasureImpl.hbm.xml - core/persistence/java/src/main/resources/fr/ird/observe/entities/data/ps/common/TripImpl.hbm.xml - core/persistence/java/src/main/resources/fr/ird/observe/entities/data/ps/observation/NonTargetCatchReleaseImpl.hbm.xml - core/persistence/java/src/main/resources/fr/ird/observe/entities/referential/common/VesselImpl.hbm.xml - model/src/main/models/Observe/persistence/attribute/digits.properties - toolkit/templates/src/main/java/fr/ird/observe/toolkit/templates/ExtractTagValues.java Changes: ===================================== core/persistence/java/src/main/resources/fr/ird/observe/entities/data/ll/landing/LandingPartImpl.hbm.xml ===================================== @@ -38,16 +38,16 @@ <many-to-one name="species" class="fr.ird.observe.entities.referential.common.SpeciesImpl" column="species" foreign-key="fk_ll_landing_landingpart_species" not-null="true" /> <many-to-one name="dataQuality" class="fr.ird.observe.entities.referential.common.DataQualityImpl" column="dataQuality" foreign-key="fk_ll_landing_landingpart_dataquality" /> <property name="categoryMin" access="field" type="java.lang.Float"> - <column name="categoryMin" sql-type="numeric"/> + <column name="categoryMin" precision="6" scale="3" sql-type="numeric"/> </property> <property name="categoryMax" access="field" type="java.lang.Float"> - <column name="categoryMax" sql-type="numeric"/> + <column name="categoryMax" precision="6" scale="3" sql-type="numeric"/> </property> <many-to-one name="onBoardProcessing" class="fr.ird.observe.entities.referential.ll.common.OnBoardProcessingImpl" column="onBoardProcessing" foreign-key="fk_ll_landing_landingpart_onboardprocessing" /> <many-to-one name="conservation" class="fr.ird.observe.entities.referential.ll.landing.ConservationImpl" column="conservation" foreign-key="fk_ll_landing_landingpart_conservation" /> <property name="count" access="field" type="java.lang.Integer" column="count"/> <property name="weight" access="field" type="java.lang.Float"> - <column name="weight" sql-type="numeric"/> + <column name="weight" precision="6" scale="3" sql-type="numeric"/> </property> <many-to-one name="weightMeasureMethod" class="fr.ird.observe.entities.referential.common.WeightMeasureMethodImpl" column="weightMeasureMethod" foreign-key="fk_ll_landing_landingpart_weightmeasuremethod" /> </class> ===================================== core/persistence/java/src/main/resources/fr/ird/observe/entities/data/ll/logbook/ActivityImpl.hbm.xml ===================================== @@ -51,12 +51,12 @@ <column name="longitude" precision="6" scale="4" sql-type="numeric"/> </property> <property name="seaSurfaceTemperature" access="field" type="java.lang.Float"> - <column name="seaSurfaceTemperature" sql-type="numeric"/> + <column name="seaSurfaceTemperature" precision="6" scale="2" sql-type="numeric"/> </property> <many-to-one name="wind" class="fr.ird.observe.entities.referential.common.WindImpl" column="wind" foreign-key="fk_ll_logbook_activity_wind" /> <property name="windDirection" access="field" type="java.lang.Integer" column="windDirection"/> <property name="currentSpeed" access="field" type="java.lang.Float"> - <column name="currentSpeed" sql-type="numeric"/> + <column name="currentSpeed" precision="6" scale="1" sql-type="numeric"/> </property> <property name="currentDirection" access="field" type="java.lang.Integer" column="currentDirection"/> <many-to-one name="vesselActivity" class="fr.ird.observe.entities.referential.ll.common.VesselActivityImpl" column="vesselActivity" foreign-key="fk_ll_logbook_activity_vesselactivity" lazy="false" not-null="true" /> ===================================== core/persistence/java/src/main/resources/fr/ird/observe/entities/data/ll/logbook/BaitsCompositionImpl.hbm.xml ===================================== @@ -38,7 +38,7 @@ <property name="proportion" access="field" type="java.lang.Integer" column="proportion"/> <property name="individualSize" access="field" type="java.lang.Integer" column="individualSize"/> <property name="individualWeight" access="field" type="java.lang.Float"> - <column name="individualWeight" sql-type="numeric"/> + <column name="individualWeight" precision="6" scale="3" sql-type="numeric"/> </property> <many-to-one name="baitSettingStatus" class="fr.ird.observe.entities.referential.ll.common.BaitSettingStatusImpl" column="baitSettingStatus" foreign-key="fk_ll_logbook_baitscomposition_baitsettingstatus" /> <many-to-one name="baitType" class="fr.ird.observe.entities.referential.ll.common.BaitTypeImpl" column="baitType" foreign-key="fk_ll_logbook_baitscomposition_baittype" not-null="true" /> ===================================== core/persistence/java/src/main/resources/fr/ird/observe/entities/data/ll/logbook/BranchlinesCompositionImpl.hbm.xml ===================================== @@ -36,11 +36,11 @@ </property> <property name="homeId" access="field" type="java.lang.String" column="homeId"/> <property name="length" access="field" type="java.lang.Float" not-null="true"> - <column name="length" sql-type="numeric"/> + <column name="length" precision="6" scale="4" sql-type="numeric"/> </property> <property name="proportion" access="field" type="java.lang.Integer" column="proportion"/> <property name="tracelineLength" access="field" type="java.lang.Float"> - <column name="tracelineLength" sql-type="numeric"/> + <column name="tracelineLength" precision="6" scale="4" sql-type="numeric"/> </property> <many-to-one name="topType" class="fr.ird.observe.entities.referential.ll.common.LineTypeImpl" column="topType" foreign-key="fk_ll_logbook_branchlinescomposition_toptype" not-null="true" /> <many-to-one name="tracelineType" class="fr.ird.observe.entities.referential.ll.common.LineTypeImpl" column="tracelineType" foreign-key="fk_ll_logbook_branchlinescomposition_tracelinetype" not-null="true" /> ===================================== core/persistence/java/src/main/resources/fr/ird/observe/entities/data/ll/logbook/CatchImpl.hbm.xml ===================================== @@ -40,12 +40,12 @@ </property> <property name="count" access="field" type="java.lang.Integer" column="count"/> <property name="totalWeight" access="field" type="java.lang.Float"> - <column name="totalWeight" sql-type="numeric"/> + <column name="totalWeight" precision="6" scale="3" sql-type="numeric"/> </property> <property name="hookWhenDiscarded" access="field" type="java.lang.Boolean" column="hookWhenDiscarded"/> <property name="depredated" access="field" type="java.lang.Boolean" column="depredated"/> <property name="beatDiameter" access="field" type="java.lang.Float"> - <column name="beatDiameter" sql-type="numeric"/> + <column name="beatDiameter" precision="6" scale="3" sql-type="numeric"/> </property> <property name="photoReferences" access="field" type="java.lang.String" column="photoReferences"/> <property name="number" access="field" type="java.lang.Integer" column="number"/> ===================================== core/persistence/java/src/main/resources/fr/ird/observe/entities/data/ll/logbook/FloatlinesCompositionImpl.hbm.xml ===================================== @@ -36,7 +36,7 @@ </property> <property name="homeId" access="field" type="java.lang.String" column="homeId"/> <property name="length" access="field" type="java.lang.Float" not-null="true"> - <column name="length" sql-type="numeric"/> + <column name="length" precision="6" scale="4" sql-type="numeric"/> </property> <property name="proportion" access="field" type="java.lang.Integer" column="proportion"/> <many-to-one name="lineType" class="fr.ird.observe.entities.referential.ll.common.LineTypeImpl" column="lineType" foreign-key="fk_ll_logbook_floatlinescomposition_linetype" not-null="true" /> ===================================== core/persistence/java/src/main/resources/fr/ird/observe/entities/data/ll/logbook/SamplePartImpl.hbm.xml ===================================== @@ -36,10 +36,10 @@ </property> <property name="homeId" access="field" type="java.lang.String" column="homeId"/> <property name="length" access="field" type="java.lang.Float"> - <column name="length" sql-type="numeric"/> + <column name="length" precision="6" scale="1" sql-type="numeric"/> </property> <property name="weight" access="field" type="java.lang.Float"> - <column name="weight" sql-type="numeric"/> + <column name="weight" precision="6" scale="2" sql-type="numeric"/> </property> <property name="count" access="field" type="java.lang.Integer" column="count" not-null="true"/> <property name="acquisitionMode" access="field" type="int" column="acquisitionMode"/> ===================================== core/persistence/java/src/main/resources/fr/ird/observe/entities/data/ll/logbook/SetImpl.hbm.xml ===================================== @@ -48,16 +48,16 @@ <property name="totalLightsticksCount" access="field" type="java.lang.Integer" column="totalLightsticksCount"/> <property name="weightedSnap" access="field" type="java.lang.Boolean" column="weightedSnap"/> <property name="snapWeight" access="field" type="java.lang.Float"> - <column name="snapWeight" sql-type="numeric"/> + <column name="snapWeight" precision="6" scale="3" sql-type="numeric"/> </property> <property name="weightedSwivel" access="field" type="java.lang.Boolean" column="weightedSwivel"/> <property name="swivelWeight" access="field" type="java.lang.Float"> - <column name="swivelWeight" sql-type="numeric"/> + <column name="swivelWeight" precision="6" scale="3" sql-type="numeric"/> </property> <property name="timeBetweenHooks" access="field" type="java.lang.Long" column="timeBetweenHooks"/> <property name="shooterUsed" access="field" type="java.lang.Boolean" column="shooterUsed"/> <property name="shooterSpeed" access="field" type="java.lang.Float"> - <column name="shooterSpeed" sql-type="numeric"/> + <column name="shooterSpeed" precision="6" scale="3" sql-type="numeric"/> </property> <property name="maxDepthTargeted" access="field" type="java.lang.Float"> <column name="maxDepthTargeted" precision="6" scale="4" sql-type="numeric"/> @@ -81,7 +81,7 @@ <column name="settingEndLongitude" precision="6" scale="4" sql-type="numeric"/> </property> <property name="settingVesselSpeed" access="field" type="java.lang.Float"> - <column name="settingVesselSpeed" sql-type="numeric"/> + <column name="settingVesselSpeed" precision="6" scale="3" sql-type="numeric"/> </property> <property name="haulingDirectionSameAsSetting" access="field" type="java.lang.Boolean" column="haulingDirectionSameAsSetting"/> <property name="haulingStartTimeStamp" access="field" type="timestamp"> ===================================== core/persistence/java/src/main/resources/fr/ird/observe/entities/data/ll/observation/BaitsCompositionImpl.hbm.xml ===================================== @@ -38,7 +38,7 @@ <property name="proportion" access="field" type="java.lang.Integer" column="proportion" not-null="true"/> <property name="individualSize" access="field" type="java.lang.Integer" column="individualSize"/> <property name="individualWeight" access="field" type="java.lang.Float"> - <column name="individualWeight" sql-type="numeric"/> + <column name="individualWeight" precision="6" scale="3" sql-type="numeric"/> </property> <many-to-one name="baitSettingStatus" class="fr.ird.observe.entities.referential.ll.common.BaitSettingStatusImpl" column="baitSettingStatus" foreign-key="fk_ll_observation_baitscomposition_baitsettingstatus" /> <many-to-one name="baitType" class="fr.ird.observe.entities.referential.ll.common.BaitTypeImpl" column="baitType" foreign-key="fk_ll_observation_baitscomposition_baittype" not-null="true" /> ===================================== core/persistence/java/src/main/resources/fr/ird/observe/entities/data/ll/observation/BasketImpl.hbm.xml ===================================== @@ -38,10 +38,10 @@ <property name="settingIdentifier" access="field" type="java.lang.Integer" column="settingIdentifier" not-null="true"/> <property name="haulingIdentifier" access="field" type="java.lang.Integer" column="haulingIdentifier"/> <property name="floatline1Length" access="field" type="java.lang.Float"> - <column name="floatline1Length" sql-type="numeric"/> + <column name="floatline1Length" precision="6" scale="4" sql-type="numeric"/> </property> <property name="floatline2Length" access="field" type="java.lang.Float"> - <column name="floatline2Length" sql-type="numeric"/> + <column name="floatline2Length" precision="6" scale="4" sql-type="numeric"/> </property> <set name="branchline" order-by="settingIdentifier" lazy="true" cascade="all,delete-orphan" > <key column="basket" foreign-key="fk_ll_observation_basket_branchline" not-null="true" /> ===================================== core/persistence/java/src/main/resources/fr/ird/observe/entities/data/ll/observation/BranchlineImpl.hbm.xml ===================================== @@ -49,7 +49,7 @@ <property name="timeSinceContact" access="field" type="java.lang.Integer" column="timeSinceContact"/> <property name="hookOffset" access="field" type="java.lang.Integer" column="hookOffset"/> <property name="branchlineLength" access="field" type="java.lang.Float"> - <column name="branchlineLength" sql-type="numeric"/> + <column name="branchlineLength" precision="6" scale="4" sql-type="numeric"/> </property> <property name="weightedSwivel" access="field" type="boolean" not-null="true"> <column default="false" name="weightedSwivel"/> @@ -61,13 +61,13 @@ <column default="false" name="weightedSnap"/> </property> <property name="swivelWeight" access="field" type="java.lang.Float"> - <column name="swivelWeight" sql-type="numeric"/> + <column name="swivelWeight" precision="6" scale="3" sql-type="numeric"/> </property> <property name="snapWeight" access="field" type="java.lang.Float"> - <column name="snapWeight" sql-type="numeric"/> + <column name="snapWeight" precision="6" scale="3" sql-type="numeric"/> </property> <property name="tracelineLength" access="field" type="java.lang.Float"> - <column name="tracelineLength" sql-type="numeric"/> + <column name="tracelineLength" precision="6" scale="4" sql-type="numeric"/> </property> <property name="hookLost" access="field" type="boolean" not-null="true"> <column default="false" name="hookLost"/> ===================================== core/persistence/java/src/main/resources/fr/ird/observe/entities/data/ll/observation/BranchlinesCompositionImpl.hbm.xml ===================================== @@ -36,11 +36,11 @@ </property> <property name="homeId" access="field" type="java.lang.String" column="homeId"/> <property name="length" access="field" type="java.lang.Float" not-null="true"> - <column name="length" sql-type="numeric"/> + <column name="length" precision="6" scale="4" sql-type="numeric"/> </property> <property name="proportion" access="field" type="java.lang.Integer" column="proportion" not-null="true"/> <property name="tracelineLength" access="field" type="java.lang.Float"> - <column name="tracelineLength" sql-type="numeric"/> + <column name="tracelineLength" precision="6" scale="4" sql-type="numeric"/> </property> <many-to-one name="topType" class="fr.ird.observe.entities.referential.ll.common.LineTypeImpl" column="topType" foreign-key="fk_ll_observation_branchlinescomposition_toptype" not-null="true" /> <many-to-one name="tracelineType" class="fr.ird.observe.entities.referential.ll.common.LineTypeImpl" column="tracelineType" foreign-key="fk_ll_observation_branchlinescomposition_tracelinetype" not-null="true" /> ===================================== core/persistence/java/src/main/resources/fr/ird/observe/entities/data/ll/observation/CatchImpl.hbm.xml ===================================== @@ -40,17 +40,17 @@ </property> <property name="count" access="field" type="java.lang.Integer" column="count" not-null="true"/> <property name="totalWeight" access="field" type="java.lang.Float"> - <column name="totalWeight" sql-type="numeric"/> + <column name="totalWeight" precision="6" scale="3" sql-type="numeric"/> </property> <property name="hookWhenDiscarded" access="field" type="java.lang.Boolean" column="hookWhenDiscarded"/> <property name="depredated" access="field" type="boolean" not-null="true"> <column default="false" name="depredated"/> </property> <property name="beatDiameter" access="field" type="java.lang.Float"> - <column name="beatDiameter" sql-type="numeric"/> + <column name="beatDiameter" precision="6" scale="3" sql-type="numeric"/> </property> <property name="gonadeWeight" access="field" type="java.lang.Float"> - <column name="gonadeWeight" sql-type="numeric"/> + <column name="gonadeWeight" precision="6" scale="3" sql-type="numeric"/> </property> <property name="photoReferences" access="field" type="java.lang.String" column="photoReferences"/> <property name="number" access="field" type="java.lang.Integer" column="number"/> ===================================== core/persistence/java/src/main/resources/fr/ird/observe/entities/data/ll/observation/EncounterImpl.hbm.xml ===================================== @@ -36,7 +36,7 @@ </property> <property name="homeId" access="field" type="java.lang.String" column="homeId"/> <property name="distance" access="field" type="java.lang.Float"> - <column name="distance" sql-type="numeric"/> + <column name="distance" precision="6" scale="3" sql-type="numeric"/> </property> <property name="count" access="field" type="java.lang.Integer" column="count"/> <many-to-one name="encounterType" class="fr.ird.observe.entities.referential.ll.observation.EncounterTypeImpl" column="encounterType" foreign-key="fk_ll_observation_encounter_encountertype" not-null="true" /> ===================================== core/persistence/java/src/main/resources/fr/ird/observe/entities/data/ll/observation/FloatlinesCompositionImpl.hbm.xml ===================================== @@ -36,7 +36,7 @@ </property> <property name="homeId" access="field" type="java.lang.String" column="homeId"/> <property name="length" access="field" type="java.lang.Float" not-null="true"> - <column name="length" sql-type="numeric"/> + <column name="length" precision="6" scale="4" sql-type="numeric"/> </property> <property name="proportion" access="field" type="java.lang.Integer" column="proportion" not-null="true"/> <many-to-one name="lineType" class="fr.ird.observe.entities.referential.ll.common.LineTypeImpl" column="lineType" foreign-key="fk_ll_observation_floatlinescomposition_linetype" not-null="true" /> ===================================== core/persistence/java/src/main/resources/fr/ird/observe/entities/data/ll/observation/SetImpl.hbm.xml ===================================== @@ -48,13 +48,13 @@ <column default="false" name="weightedSnap"/> </property> <property name="snapWeight" access="field" type="java.lang.Float"> - <column name="snapWeight" sql-type="numeric"/> + <column name="snapWeight" precision="6" scale="3" sql-type="numeric"/> </property> <property name="weightedSwivel" access="field" type="boolean" not-null="true"> <column default="false" name="weightedSwivel"/> </property> <property name="swivelWeight" access="field" type="java.lang.Float"> - <column name="swivelWeight" sql-type="numeric"/> + <column name="swivelWeight" precision="6" scale="3" sql-type="numeric"/> </property> <property name="lightsticksPerBasketCount" access="field" type="java.lang.Integer" column="lightsticksPerBasketCount"/> <property name="timeBetweenHooks" access="field" type="java.lang.Long" column="timeBetweenHooks"/> @@ -62,7 +62,7 @@ <column default="false" name="shooterUsed"/> </property> <property name="shooterSpeed" access="field" type="java.lang.Float"> - <column name="shooterSpeed" sql-type="numeric"/> + <column name="shooterSpeed" precision="6" scale="4" sql-type="numeric"/> </property> <property name="maxDepthTargeted" access="field" type="java.lang.Float"> <column name="maxDepthTargeted" precision="6" scale="4" sql-type="numeric"/> ===================================== core/persistence/java/src/main/resources/fr/ird/observe/entities/data/ll/observation/SizeMeasureImpl.hbm.xml ===================================== @@ -36,7 +36,7 @@ </property> <property name="homeId" access="field" type="java.lang.String" column="homeId"/> <property name="size" access="field" type="java.lang.Float" not-null="true"> - <column name="size" sql-type="numeric"/> + <column name="size" precision="6" scale="4" sql-type="numeric"/> </property> <many-to-one name="sizeMeasureType" class="fr.ird.observe.entities.referential.common.SizeMeasureTypeImpl" column="sizeMeasureType" foreign-key="fk_ll_observation_sizemeasure_sizemeasuretype" not-null="true" /> </class> ===================================== core/persistence/java/src/main/resources/fr/ird/observe/entities/data/ll/observation/TdrImpl.hbm.xml ===================================== @@ -36,10 +36,10 @@ </property> <property name="homeId" access="field" type="java.lang.String" column="homeId"/> <property name="floatline1Length" access="field" type="java.lang.Float"> - <column name="floatline1Length" sql-type="numeric"/> + <column name="floatline1Length" precision="6" scale="4" sql-type="numeric"/> </property> <property name="floatline2Length" access="field" type="java.lang.Float"> - <column name="floatline2Length" sql-type="numeric"/> + <column name="floatline2Length" precision="6" scale="4" sql-type="numeric"/> </property> <property name="serialNo" access="field" type="java.lang.String" column="serialNo"/> <property name="data" access="field" type="java.sql.Blob" column="data"/> @@ -58,28 +58,28 @@ <column name="fishingEnd" sql-type="timestamp"/> </property> <property name="fishingStartDepth" access="field" type="java.lang.Float"> - <column name="fishingStartDepth" sql-type="numeric"/> + <column name="fishingStartDepth" precision="6" scale="2" sql-type="numeric"/> </property> <property name="fishingEndDepth" access="field" type="java.lang.Float"> - <column name="fishingEndDepth" sql-type="numeric"/> + <column name="fishingEndDepth" precision="6" scale="2" sql-type="numeric"/> </property> <property name="meanDeploymentDepth" access="field" type="java.lang.Float"> - <column name="meanDeploymentDepth" sql-type="numeric"/> + <column name="meanDeploymentDepth" precision="6" scale="2" sql-type="numeric"/> </property> <property name="medianDeploymentDepth" access="field" type="java.lang.Float"> - <column name="medianDeploymentDepth" sql-type="numeric"/> + <column name="medianDeploymentDepth" precision="6" scale="2" sql-type="numeric"/> </property> <property name="minFishingDepth" access="field" type="java.lang.Float"> - <column name="minFishingDepth" sql-type="numeric"/> + <column name="minFishingDepth" precision="6" scale="2" sql-type="numeric"/> </property> <property name="maxFishingDepth" access="field" type="java.lang.Float"> - <column name="maxFishingDepth" sql-type="numeric"/> + <column name="maxFishingDepth" precision="6" scale="2" sql-type="numeric"/> </property> <property name="meanFishingDepth" access="field" type="java.lang.Float"> - <column name="meanFishingDepth" sql-type="numeric"/> + <column name="meanFishingDepth" precision="6" scale="2" sql-type="numeric"/> </property> <property name="medianFishingDepth" access="field" type="java.lang.Float"> - <column name="medianFishingDepth" sql-type="numeric"/> + <column name="medianFishingDepth" precision="6" scale="2" sql-type="numeric"/> </property> <many-to-one name="section" class="fr.ird.observe.entities.data.ll.observation.SectionImpl" column="section" foreign-key="fk_ll_observation_tdr_section" /> <many-to-one name="basket" class="fr.ird.observe.entities.data.ll.observation.BasketImpl" column="basket" foreign-key="fk_ll_observation_tdr_basket" /> ===================================== core/persistence/java/src/main/resources/fr/ird/observe/entities/data/ll/observation/WeightMeasureImpl.hbm.xml ===================================== @@ -36,7 +36,7 @@ </property> <property name="homeId" access="field" type="java.lang.String" column="homeId"/> <property name="weight" access="field" type="java.lang.Float" not-null="true"> - <column name="weight" sql-type="numeric"/> + <column name="weight" precision="6" scale="4" sql-type="numeric"/> </property> <many-to-one name="weightMeasureType" class="fr.ird.observe.entities.referential.common.WeightMeasureTypeImpl" column="weightMeasureType" foreign-key="fk_ll_observation_weightmeasure_weightmeasuretype" not-null="true" /> </class> ===================================== core/persistence/java/src/main/resources/fr/ird/observe/entities/data/ps/common/TripImpl.hbm.xml ===================================== @@ -45,10 +45,10 @@ <property name="timeAtSea" access="field" type="java.lang.Integer" column="timeAtSea"/> <property name="fishingTime" access="field" type="java.lang.Integer" column="fishingTime"/> <property name="landingTotalWeight" access="field" type="java.lang.Float"> - <column name="landingTotalWeight" sql-type="numeric"/> + <column name="landingTotalWeight" precision="6" scale="3" sql-type="numeric"/> </property> <property name="localMarketTotalWeight" access="field" type="java.lang.Float"> - <column name="localMarketTotalWeight" sql-type="numeric"/> + <column name="localMarketTotalWeight" precision="6" scale="3" sql-type="numeric"/> </property> <property name="loch" access="field" type="java.lang.Integer" column="loch"/> <property name="generalComment" access="field" type="java.lang.String" length="8192"> ===================================== core/persistence/java/src/main/resources/fr/ird/observe/entities/data/ps/observation/NonTargetCatchReleaseImpl.hbm.xml ===================================== @@ -39,7 +39,7 @@ <column length="8192" name="comment"/> </property> <property name="length" access="field" type="java.lang.Float"> - <column name="length" sql-type="numeric"/> + <column name="length" precision="6" scale="3" sql-type="numeric"/> </property> <property name="count" access="field" type="java.lang.Integer" column="count" not-null="true"/> <property name="brailNumber" access="field" type="java.lang.Integer" column="brailNumber"/> ===================================== core/persistence/java/src/main/resources/fr/ird/observe/entities/referential/common/VesselImpl.hbm.xml ===================================== @@ -64,7 +64,7 @@ <column name="length" precision="6" scale="2" sql-type="numeric"/> </property> <property name="capacity" access="field" type="java.lang.Float"> - <column name="capacity" sql-type="numeric"/> + <column name="capacity" precision="6" scale="2" sql-type="numeric"/> </property> <property name="powerCv" access="field" type="java.lang.Integer" column="powerCv"/> <property name="powerKW" access="field" type="java.lang.Integer" column="powerKW"/> ===================================== model/src/main/models/Observe/persistence/attribute/digits.properties ===================================== @@ -21,10 +21,23 @@ ### data.ll.landing.Landing.attribute.latitude=4 data.ll.landing.Landing.attribute.longitude=4 +data.ll.landing.LandingPart.attribute.categoryMax=3 +data.ll.landing.LandingPart.attribute.categoryMin=3 +data.ll.landing.LandingPart.attribute.weight=3 +data.ll.logbook.Activity.attribute.currentSpeed=1 data.ll.logbook.Activity.attribute.latitude=4 data.ll.logbook.Activity.attribute.longitude=4 +data.ll.logbook.Activity.attribute.seaSurfaceTemperature=2 +data.ll.logbook.BaitsComposition.attribute.individualWeight=3 +data.ll.logbook.BranchlinesComposition.attribute.length=4 +data.ll.logbook.BranchlinesComposition.attribute.tracelineLength=4 +data.ll.logbook.Catch.attribute.beatDiameter=3 +data.ll.logbook.Catch.attribute.totalWeight=3 +data.ll.logbook.FloatlinesComposition.attribute.length=4 data.ll.logbook.Sample.attribute.latitude=4 data.ll.logbook.Sample.attribute.longitude=4 +data.ll.logbook.SamplePart.attribute.length=1 +data.ll.logbook.SamplePart.attribute.weight=2 data.ll.logbook.Set.attribute.basketLineLength=4 data.ll.logbook.Set.attribute.haulingEndLatitude=4 data.ll.logbook.Set.attribute.haulingEndLongitude=4 @@ -36,10 +49,28 @@ data.ll.logbook.Set.attribute.settingEndLatitude=4 data.ll.logbook.Set.attribute.settingEndLongitude=4 data.ll.logbook.Set.attribute.settingStartLatitude=4 data.ll.logbook.Set.attribute.settingStartLongitude=4 +data.ll.logbook.Set.attribute.settingVesselSpeed=3 +data.ll.logbook.Set.attribute.shooterSpeed=3 +data.ll.logbook.Set.attribute.snapWeight=3 +data.ll.logbook.Set.attribute.swivelWeight=3 data.ll.logbook.Set.attribute.totalLineLength=4 data.ll.observation.Activity.attribute.latitude=4 data.ll.observation.Activity.attribute.longitude=4 data.ll.observation.Activity.attribute.seaSurfaceTemperature=2 +data.ll.observation.BaitsComposition.attribute.individualWeight=3 +data.ll.observation.Basket.attribute.floatline1Length=4 +data.ll.observation.Basket.attribute.floatline2Length=4 +data.ll.observation.Branchline.attribute.branchlineLength=4 +data.ll.observation.Branchline.attribute.snapWeight=3 +data.ll.observation.Branchline.attribute.swivelWeight=3 +data.ll.observation.Branchline.attribute.tracelineLength=4 +data.ll.observation.BranchlinesComposition.attribute.length=4 +data.ll.observation.BranchlinesComposition.attribute.tracelineLength=4 +data.ll.observation.Catch.attribute.beatDiameter=3 +data.ll.observation.Catch.attribute.gonadeWeight=3 +data.ll.observation.Catch.attribute.totalWeight=3 +data.ll.observation.Encounter.attribute.distance=3 +data.ll.observation.FloatlinesComposition.attribute.length=4 data.ll.observation.Set.attribute.haulingEndLatitude=4 data.ll.observation.Set.attribute.haulingEndLongitude=4 data.ll.observation.Set.attribute.haulingStartLatitude=4 @@ -50,6 +81,23 @@ data.ll.observation.Set.attribute.settingEndLongitude=4 data.ll.observation.Set.attribute.settingStartLatitude=4 data.ll.observation.Set.attribute.settingStartLongitude=4 data.ll.observation.Set.attribute.settingVesselSpeed=2 +data.ll.observation.Set.attribute.shooterSpeed=4 +data.ll.observation.Set.attribute.snapWeight=3 +data.ll.observation.Set.attribute.swivelWeight=3 +data.ll.observation.SizeMeasure.attribute.size=4 +data.ll.observation.Tdr.attribute.fishingEndDepth=2 +data.ll.observation.Tdr.attribute.fishingStartDepth=2 +data.ll.observation.Tdr.attribute.floatline1Length=4 +data.ll.observation.Tdr.attribute.floatline2Length=4 +data.ll.observation.Tdr.attribute.maxFishingDepth=2 +data.ll.observation.Tdr.attribute.meanDeploymentDepth=2 +data.ll.observation.Tdr.attribute.meanFishingDepth=2 +data.ll.observation.Tdr.attribute.medianDeploymentDepth=2 +data.ll.observation.Tdr.attribute.medianFishingDepth=2 +data.ll.observation.Tdr.attribute.minFishingDepth=2 +data.ll.observation.WeightMeasure.attribute.weight=4 +data.ps.common.Trip.attribute.landingTotalWeight=3 +data.ps.common.Trip.attribute.localMarketTotalWeight=3 data.ps.landing.Landing.attribute.weight=4 data.ps.localmarket.Batch.attribute.weight=4 data.ps.localmarket.SampleSpeciesMeasure.attribute.sizeClass=1 @@ -79,6 +127,7 @@ data.ps.observation.Catch.attribute.maxWeight=4 data.ps.observation.Catch.attribute.meanLength=1 data.ps.observation.Catch.attribute.meanWeight=2 data.ps.observation.Catch.attribute.minWeight=4 +data.ps.observation.NonTargetCatchRelease.attribute.length=3 data.ps.observation.Route.attribute.endLogValue=2 data.ps.observation.Route.attribute.startLogValue=2 data.ps.observation.SampleMeasure.attribute.length=1 @@ -94,6 +143,7 @@ referential.common.Species.attribute.maxLength=2 referential.common.Species.attribute.maxWeight=2 referential.common.Species.attribute.minLength=2 referential.common.Species.attribute.minWeight=2 +referential.common.Vessel.attribute.capacity=2 referential.common.Vessel.attribute.length=2 referential.common.Vessel.attribute.searchMaximum=2 referential.common.Wind.attribute.maxSwellHeight=2 ===================================== toolkit/templates/src/main/java/fr/ird/observe/toolkit/templates/ExtractTagValues.java ===================================== @@ -24,6 +24,7 @@ package fr.ird.observe.toolkit.templates; import fr.ird.observe.dto.WithAtLeastOneSelected; import fr.ird.observe.dto.data.NoValidationDto; +import fr.ird.observe.spi.ProjectPackagesDefinition; import fr.ird.observe.toolkit.templates.io.TagValuesExtractor; import fr.ird.observe.toolkit.templates.validation.ValidationTagValues; import io.ultreia.java4all.util.SortedProperties; @@ -35,11 +36,14 @@ import org.nuiton.eugene.models.object.ObjectModelAttribute; import org.nuiton.eugene.models.object.ObjectModelClass; import org.nuiton.eugene.models.object.ObjectModelGenerator; import org.nuiton.eugene.models.object.ObjectModelType; +import org.nuiton.topia.templates.TopiaExtensionTagValues; import org.nuiton.topia.templates.TopiaHibernateTagValues; import java.io.File; import java.io.IOException; import java.io.Writer; +import java.net.URL; +import java.net.URLClassLoader; import java.nio.file.Path; import java.util.ArrayList; import java.util.List; @@ -55,6 +59,11 @@ import java.util.Set; @Component(role = Template.class, hint = "fr.ird.observe.toolkit.templates.ExtractTagValues") public class ExtractTagValues extends ObjectModelGenerator { + private static final Set<String> DECIMAL_TYPES = Set.of( + Float.class.getSimpleName(), Float.class.getName(), + Double.class.getSimpleName(), Double.class.getName() + ); + private String filePrefix; private Path outputFile; private Path resourceDirectory; @@ -67,6 +76,7 @@ public class ExtractTagValues extends ObjectModelGenerator { Path rootResourcePath = getConfiguration().getProperty(PROP_RESOURCE_DIRECTORY, File.class).toPath(); Path rootOutputPath = getConfiguration().getProperty(PROP_OUTPUT_DIRECTORY, File.class).toPath().getParent().resolve("java"); + String classifier; if (packageName.contains(".dto")) { classifier = "dto"; @@ -78,7 +88,11 @@ public class ExtractTagValues extends ObjectModelGenerator { resourceDirectory = TagValuesExtractor.getModelPath(rootResourcePath, model, classifier); getLog().info(String.format("[%s] Will generate tag values at %s", classifier, resourceDirectory)); - extractor = createExtractor(model, packageName, classifier); + ProjectPackagesDefinition projectPackagesDefinition; + try (URLClassLoader urlClassLoader = new URLClassLoader(new URL[]{rootResourcePath.toUri().toURL()}, getClassLoader())) { + projectPackagesDefinition = ProjectPackagesDefinition.of(urlClassLoader); + } + extractor = createExtractor(model, packageName, classifier, projectPackagesDefinition); extractor.load(getClassLoader(), resourceDirectory); Set<String> tagValueKeys = extractor.getModelTagValueKeys(); @@ -88,14 +102,15 @@ public class ExtractTagValues extends ObjectModelGenerator { } extractor.store(rootOutputPath); } - - protected TagValuesExtractor createExtractor(ObjectModel model, String packageName, String classifier) { + protected TagValuesExtractor createExtractor(ObjectModel model, String packageName, String classifier, ProjectPackagesDefinition projectPackagesDefinition) { if ("persistence".equals(classifier)) { return new TagValuesExtractor(model, packageName, classifier, getLog()) { + @Override protected void extractAttributeTagValues(ObjectModelClass aClass, ObjectModelAttribute attribute) { super.extractAttributeTagValues(aClass, attribute); checkDateTagValue(aClass, attribute); + checkDecimalAttribute(aClass, attribute); } private void checkDateTagValue(ObjectModelClass aClass, ObjectModelAttribute attribute) { @@ -109,6 +124,18 @@ public class ExtractTagValues extends ObjectModelGenerator { throw new IllegalStateException(String.format("Missing hibernateAttributeType.java.util.Date tag-value on %s#%s (you can use time, date or timestamp)", aClass.getQualifiedName(), attributeName)); } } + + private void checkDecimalAttribute( ObjectModelClass aClass, ObjectModelAttribute attribute) { + if (DECIMAL_TYPES.contains(attribute.getType())) { + // check if digits tag value is set + String attributeName = attribute.getName(); + boolean booleanTagValue = containsAttributeTagValue(aClass, attributeName, TopiaExtensionTagValues.Store.digits.name()); + if (booleanTagValue) { + return; + } + throw new IllegalStateException(String.format("Missing digits tag-value on %1$s#%2$s (you need to set it on %1$s.attribute.%2$s)", projectPackagesDefinition.getRelativeEntityPackage(aClass.getQualifiedName()).substring(1), attributeName)); + } + } }; } if ("dto".equals(classifier)) { View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/02bad5814cd6573b50c483941... -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/02bad5814cd6573b50c483941... You're receiving this email because of your account on gitlab.com.