Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe

Commits:

19 changed files:

Changes:

  • client-core/src/main/i18n/getters/jaxx.getter
    ... ... @@ -876,11 +876,11 @@ observe.common.VesselActivitySeineDto.allowFad
    876 876
     observe.common.VesselDto.capacity
    
    877 877
     observe.common.VesselDto.changeDate
    
    878 878
     observe.common.VesselDto.comId
    
    879
    -observe.common.VesselDto.ctoiId
    
    880 879
     observe.common.VesselDto.flagCountry
    
    881 880
     observe.common.VesselDto.generalTab
    
    882
    -observe.common.VesselDto.iattcId
    
    881
    +observe.common.VesselDto.iccat
    
    883 882
     observe.common.VesselDto.imoId
    
    883
    +observe.common.VesselDto.iotcId
    
    884 884
     observe.common.VesselDto.keelCodeFlotte
    
    885 885
     observe.common.VesselDto.length
    
    886 886
     observe.common.VesselDto.lloydId
    

  • client-core/src/main/java/fr/ird/observe/client/ui/content/ref/common/VesselUI.jaxx
    ... ... @@ -220,13 +220,13 @@ fr.ird.observe.client.ui.util.BeanCheckBox
    220 220
                     </cell>
    
    221 221
                   </row>
    
    222 222
     
    
    223
    -              <!-- ctoiId -->
    
    223
    +              <!-- iotcId -->
    
    224 224
                   <row>
    
    225 225
                     <cell anchor="west">
    
    226
    -                  <JLabel id='ctoiIdLabel'/>
    
    226
    +                  <JLabel id='iotcIdLabel'/>
    
    227 227
                     </cell>
    
    228 228
                     <cell anchor='east' weightx="1" fill="both">
    
    229
    -                  <NormalTextEditor id='ctoiId'/>
    
    229
    +                  <NormalTextEditor id='iotcId'/>
    
    230 230
                     </cell>
    
    231 231
                   </row>
    
    232 232
     
    
    ... ... @@ -240,13 +240,13 @@ fr.ird.observe.client.ui.util.BeanCheckBox
    240 240
                     </cell>
    
    241 241
                   </row>
    
    242 242
     
    
    243
    -              <!-- iattcId -->
    
    243
    +              <!-- iccat -->
    
    244 244
                   <row>
    
    245 245
                     <cell anchor="west">
    
    246
    -                  <JLabel id='iattcIdLabel'/>
    
    246
    +                  <JLabel id='iccatLabel'/>
    
    247 247
                     </cell>
    
    248 248
                     <cell anchor='east' weightx="1" fill="both">
    
    249
    -                  <NormalTextEditor id='iattcId'/>
    
    249
    +                  <NormalTextEditor id='iccat'/>
    
    250 250
                     </cell>
    
    251 251
                   </row>
    
    252 252
     
    

  • client-core/src/main/java/fr/ird/observe/client/ui/content/ref/common/VesselUIModel.java
    ... ... @@ -52,8 +52,8 @@ public class VesselUIModel extends ContentReferenceUIModel<VesselDto, VesselRefe
    52 52
                           VesselDto.PROPERTY_SEARCH_MAXIMUM,
    
    53 53
                           VesselDto.PROPERTY_CHANGE_DATE,
    
    54 54
                           VesselDto.PROPERTY_COM_ID,
    
    55
    -                      VesselDto.PROPERTY_CTOI_ID,
    
    56
    -                      VesselDto.PROPERTY_IATTC_ID,
    
    55
    +                      VesselDto.PROPERTY_IOTC_ID,
    
    56
    +                      VesselDto.PROPERTY_ICCAT,
    
    57 57
                           VesselDto.PROPERTY_IMO_ID,
    
    58 58
                           VesselDto.PROPERTY_NATIONAL_ID,
    
    59 59
                           VesselDto.PROPERTY_RADIO_CALL_SIGN_ID,
    

  • dto/src/main/models/Observe-01-referential-common.model
    ... ... @@ -148,8 +148,8 @@ capacity + {*:1} Float
    148 148
     power + {*:1} Integer
    
    149 149
     searchMaximum + {*:1} Float
    
    150 150
     comment + {*:1} String
    
    151
    -iattcId + {*:1} String
    
    152
    -ctoiId + {*:1} String
    
    151
    +iccat + {*:1} String
    
    152
    +iotcId + {*:1} String
    
    153 153
     nationalId + {*:1} String
    
    154 154
     comId + {*:1} String
    
    155 155
     tuviId + {*:1} String
    

  • observe-i18n/src/main/i18n/translations/observe_en_GB.properties
    ... ... @@ -2500,12 +2500,12 @@ observe.common.VesselActivitySeineDto.types=Vessel activities (Seine)
    2500 2500
     observe.common.VesselDto.capacity=Capacity
    
    2501 2501
     observe.common.VesselDto.changeDate=Change date
    
    2502 2502
     observe.common.VesselDto.comId=EU Id
    
    2503
    -observe.common.VesselDto.ctoiId=IOTC id
    
    2504 2503
     observe.common.VesselDto.flagCountry=Flag country
    
    2505 2504
     observe.common.VesselDto.fleetCountry=Fleet country
    
    2506 2505
     observe.common.VesselDto.generalTab=General caracteristics
    
    2507
    -observe.common.VesselDto.iattcId=ICCAT Id
    
    2506
    +observe.common.VesselDto.iccat=ICCAT Id
    
    2508 2507
     observe.common.VesselDto.imoId=IMO Id
    
    2508
    +observe.common.VesselDto.iotcId=IOTC id
    
    2509 2509
     observe.common.VesselDto.keelCode=Keel code
    
    2510 2510
     observe.common.VesselDto.keelCodeFlotte=Keel / Flotte
    
    2511 2511
     observe.common.VesselDto.length=Length
    

  • observe-i18n/src/main/i18n/translations/observe_es_ES.properties
    ... ... @@ -2500,12 +2500,12 @@ observe.common.VesselActivitySeineDto.types=Actividades buque \#TODO-SP
    2500 2500
     observe.common.VesselDto.capacity=Capacidad de transporte
    
    2501 2501
     observe.common.VesselDto.changeDate=Fecha de carga
    
    2502 2502
     observe.common.VesselDto.comId=Id EU
    
    2503
    -observe.common.VesselDto.ctoiId=Id IOTC
    
    2504 2503
     observe.common.VesselDto.flagCountry=Bandera
    
    2505 2504
     observe.common.VesselDto.fleetCountry=País
    
    2506 2505
     observe.common.VesselDto.generalTab=Características generales
    
    2507
    -observe.common.VesselDto.iattcId=Id CICAA
    
    2506
    +observe.common.VesselDto.iccat=Id CICAA
    
    2508 2507
     observe.common.VesselDto.imoId=Id IMO
    
    2508
    +observe.common.VesselDto.iotcId=Id IOTC
    
    2509 2509
     observe.common.VesselDto.keelCode=Código de Quilla
    
    2510 2510
     observe.common.VesselDto.keelCodeFlotte=Código de Quilla / Flota
    
    2511 2511
     observe.common.VesselDto.length=Longitud eslora total
    

  • observe-i18n/src/main/i18n/translations/observe_fr_FR.properties
    ... ... @@ -2500,12 +2500,12 @@ observe.common.VesselActivitySeineDto.types=Activités bateau (Senne)
    2500 2500
     observe.common.VesselDto.capacity=Capacité transport (m³)
    
    2501 2501
     observe.common.VesselDto.changeDate=Date changement pavillon
    
    2502 2502
     observe.common.VesselDto.comId=Id EU
    
    2503
    -observe.common.VesselDto.ctoiId=Id CTOI
    
    2504 2503
     observe.common.VesselDto.flagCountry=Pavillon
    
    2505 2504
     observe.common.VesselDto.fleetCountry=Flotte
    
    2506 2505
     observe.common.VesselDto.generalTab=Caractéristiques générales
    
    2507
    -observe.common.VesselDto.iattcId=Id CICTA
    
    2506
    +observe.common.VesselDto.iccat=Id CICTA
    
    2508 2507
     observe.common.VesselDto.imoId=Id IMO
    
    2508
    +observe.common.VesselDto.iotcId=Id CTOI
    
    2509 2509
     observe.common.VesselDto.keelCode=Code quille
    
    2510 2510
     observe.common.VesselDto.keelCodeFlotte=Code quille /Code flotte
    
    2511 2511
     observe.common.VesselDto.length=Longueur hors tout
    

  • persistence/src/main/java/fr/ird/observe/binder/referential/common/VesselEntityDtoBinder.java
    ... ... @@ -56,8 +56,8 @@ public class VesselEntityDtoBinder extends ReferentialEntityDtoBinderSupport<Ves
    56 56
             entity.setSearchMaximum(dto.getSearchMaximum());
    
    57 57
             entity.setComment(dto.getComment());
    
    58 58
             entity.setComId(dto.getComId());
    
    59
    -        entity.setCtoiId(dto.getCtoiId());
    
    60
    -        entity.setIattcId(dto.getIattcId());
    
    59
    +        entity.setIotcId(dto.getIotcId());
    
    60
    +        entity.setIccat(dto.getIccat());
    
    61 61
             entity.setImoId(dto.getImoId());
    
    62 62
             entity.setNationalId(dto.getNationalId());
    
    63 63
             entity.setRadioCallSignId(dto.getRadioCallSignId());
    
    ... ... @@ -83,8 +83,8 @@ public class VesselEntityDtoBinder extends ReferentialEntityDtoBinderSupport<Ves
    83 83
             dto.setSearchMaximum(entity.getSearchMaximum());
    
    84 84
             dto.setComment(entity.getComment());
    
    85 85
             dto.setComId(entity.getComId());
    
    86
    -        dto.setCtoiId(entity.getCtoiId());
    
    87
    -        dto.setIattcId(entity.getIattcId());
    
    86
    +        dto.setIotcId(entity.getIotcId());
    
    87
    +        dto.setIccat(entity.getIccat());
    
    88 88
             dto.setImoId(entity.getImoId());
    
    89 89
             dto.setNationalId(entity.getNationalId());
    
    90 90
             dto.setRadioCallSignId(entity.getRadioCallSignId());
    

  • persistence/src/main/models/Observe-01-referential-common.model
    ... ... @@ -38,7 +38,7 @@ species {*:1} referential.common.Species | notNull lazy=false
    38 38
     sex {*:1} referential.common.Sex | notNull lazy=false
    
    39 39
     startDate + {*:1} Date
    
    40 40
     endDate + {*:1} Date
    
    41
    -coefficients + {*:1} String
    
    41
    +coefficients + {*:1} String | notNull
    
    42 42
     source + {*:1} String | hibernateAttributeType=text
    
    43 43
     computeFromFormulaOne(data float) Float
    
    44 44
     computeFromFormulaTwo(data float) Float
    
    ... ... @@ -65,19 +65,19 @@ getQuadrant() Integer
    65 65
     setQuadrant(quadrant Integer)
    
    66 66
     
    
    67 67
     referential.common.LengthLengthParameter > referential.common.FormulaSupport | entity
    
    68
    -inputOutputFormula + {*:1} String
    
    69
    -outputInputFormula + {*:1} String
    
    70
    -inputSizeMeasureType {*:1} referential.common.SizeMeasureType | lazy=false
    
    71
    -outputSizeMeasureType {*:1} referential.common.SizeMeasureType | lazy=false
    
    68
    +inputOutputFormula + {*:1} String | notNull
    
    69
    +outputInputFormula + {*:1} String | notNull
    
    70
    +inputSizeMeasureType {*:1} referential.common.SizeMeasureType | lazy=false notNull
    
    71
    +outputSizeMeasureType {*:1} referential.common.SizeMeasureType | lazy=false notNull
    
    72 72
     
    
    73 73
     abstract referential.common.LengthWeightAble
    
    74 74
     
    
    75 75
     referential.common.LengthWeightParameter > referential.common.FormulaSupport | entity
    
    76
    -lengthWeightFormula + {*:1} String
    
    77
    -weightLengthFormula + {*:1} String
    
    76
    +lengthWeightFormula + {*:1} String | notNull
    
    77
    +weightLengthFormula + {*:1} String | notNull
    
    78 78
     meanLength + {*:1} Float
    
    79 79
     meanWeight + {*:1} Float
    
    80
    -sizeMeasureType {*:0..1} referential.common.SizeMeasureType | lazy=false
    
    80
    +sizeMeasureType {*:0..1} referential.common.SizeMeasureType | lazy=false notNull
    
    81 81
     
    
    82 82
     referential.common.LengthMeasureMethod > referential.I18nReferentialEntity | entity
    
    83 83
     
    
    ... ... @@ -163,8 +163,8 @@ capacity + {*:1} Float | sqlType=numeric
    163 163
     power + {*:1} Integer
    
    164 164
     searchMaximum + {*:1} Float | sqlType=numeric
    
    165 165
     comment + {*:1} String | hibernateAttributeType=text
    
    166
    -iattcId + {*:1} String
    
    167
    -ctoiId + {*:1} String
    
    166
    +iccat + {*:1} String
    
    167
    +iotcId + {*:1} String
    
    168 168
     nationalId + {*:1} String
    
    169 169
     comId + {*:1} String
    
    170 170
     tuviId + {*:1} String
    

  • persistence/src/main/resources/db/migration/8.0/101_create_common_schema-common.sql
    ... ... @@ -40,13 +40,13 @@ CREATE TABLE common.shipowner(topiaid VARCHAR(255) NOT NULL CONSTRAINT pk_ship_o
    40 40
     CREATE TABLE common.sizemeasuretype(topiaid VARCHAR(255) NOT NULL CONSTRAINT pk_sizemeasuretype PRIMARY KEY, topiaversion BIGINT NOT NULL, topiacreatedate DATE NOT NULL, lastupdatedate TIMESTAMP NOT NULL, code VARCHAR(255), status INTEGER DEFAULT 1, needcomment BOOLEAN DEFAULT FALSE, uri VARCHAR(255), label1 VARCHAR(255), label2 VARCHAR(255), label3 VARCHAR(255), label4 VARCHAR(255), label5 VARCHAR(255), label6 VARCHAR(255), label7 VARCHAR(255), label8 VARCHAR(255));
    
    41 41
     CREATE TABLE common.speciesgroup(topiaid VARCHAR(255) NOT NULL CONSTRAINT pk_speciesgroup PRIMARY KEY, topiaversion BIGINT NOT NULL, topiacreatedate DATE NOT NULL, code VARCHAR(255), uri VARCHAR(255), status INTEGER DEFAULT 1, needcomment BOOLEAN, label1 VARCHAR(255), label2 VARCHAR(255), label3 VARCHAR(255), label4 VARCHAR(255), label5 VARCHAR(255), label6 VARCHAR(255), label7 VARCHAR(255), label8 VARCHAR(255), lastupdatedate TIMESTAMP DEFAULT now() NOT NULL);
    
    42 42
     CREATE TABLE common.species(topiaid VARCHAR(255) NOT NULL CONSTRAINT pk_species PRIMARY KEY, topiaversion BIGINT NOT NULL, topiacreatedate DATE NOT NULL, code VARCHAR(255), homeid VARCHAR(255), wormsid BIGINT, uri VARCHAR(255), status INTEGER DEFAULT 1, faocode VARCHAR(255), needcomment BOOLEAN, scientificlabel VARCHAR(255), label1 VARCHAR(255), label2 VARCHAR(255), label3 VARCHAR(255), label4 VARCHAR(255), label5 VARCHAR(255), label6 VARCHAR(255), label7 VARCHAR(255), label8 VARCHAR(255), minlength NUMERIC, maxlength NUMERIC, minweight NUMERIC, maxweight NUMERIC, speciesgroup VARCHAR(255), lastupdatedate TIMESTAMP DEFAULT now() NOT NULL, sizemeasuretype VARCHAR(255));
    
    43
    -CREATE TABLE common.lengthlengthparameter(topiaid VARCHAR(255) NOT NULL CONSTRAINT pk_lengthlengthparameter PRIMARY KEY, topiaversion BIGINT NOT NULL, inputsizemeasuretype VARCHAR(255) NOT NULL, outputsizemeasuretype VARCHAR(255) NOT NULL, topiacreatedate DATE NOT NULL, uri VARCHAR(255), status INTEGER DEFAULT 1, coefficients VARCHAR(255), inputoutputformula VARCHAR(255), outputinputformula VARCHAR(255), code VARCHAR(255) DEFAULT 0, needcomment BOOLEAN DEFAULT FALSE, lastupdatedate TIMESTAMP DEFAULT now() NOT NULL, source VARCHAR(1025), species VARCHAR(255), ocean VARCHAR(255), sex VARCHAR(255), startdate DATE, enddate DATE);
    
    44
    -CREATE TABLE common.lengthweightparameter(topiaid VARCHAR(255) NOT NULL CONSTRAINT pk_lengthweightparameter PRIMARY KEY, topiaversion BIGINT NOT NULL, ocean VARCHAR(255), species VARCHAR(255) NOT NULL, topiacreatedate DATE NOT NULL, uri VARCHAR(255), status INTEGER DEFAULT 1, startdate TIMESTAMP, enddate TIMESTAMP, coefficients VARCHAR(255), lengthweightformula VARCHAR(255), weightlengthformula VARCHAR(255), meanlength NUMERIC, meanweight NUMERIC, sex VARCHAR(255), code VARCHAR(255) DEFAULT 0, needcomment BOOLEAN DEFAULT FALSE, lastupdatedate TIMESTAMP DEFAULT now() NOT NULL, source VARCHAR(1025), sizemeasuretype VARCHAR(255));
    
    43
    +CREATE TABLE common.lengthlengthparameter(topiaid VARCHAR(255) NOT NULL CONSTRAINT pk_lengthlengthparameter PRIMARY KEY, topiaversion BIGINT NOT NULL, inputsizemeasuretype VARCHAR(255) NOT NULL, outputsizemeasuretype VARCHAR(255) NOT NULL, topiacreatedate DATE NOT NULL, uri VARCHAR(255), status INTEGER DEFAULT 1, coefficients VARCHAR(255) NOT NULL, inputoutputformula VARCHAR(255) NOT NULL, outputinputformula VARCHAR(255) NOT NULL, code VARCHAR(255) DEFAULT 0, needcomment BOOLEAN DEFAULT FALSE, lastupdatedate TIMESTAMP DEFAULT now() NOT NULL, source VARCHAR(1025), species VARCHAR(255) NOT NULL, ocean VARCHAR(255) NOT NULL, sex VARCHAR(255) NOT NULL, startdate DATE, enddate DATE);
    
    44
    +CREATE TABLE common.lengthweightparameter(topiaid VARCHAR(255) NOT NULL CONSTRAINT pk_lengthweightparameter PRIMARY KEY, topiaversion BIGINT NOT NULL, ocean VARCHAR(255) NOT NULL, species VARCHAR(255) NOT NULL, topiacreatedate DATE NOT NULL, uri VARCHAR(255), status INTEGER DEFAULT 1, startdate TIMESTAMP, enddate TIMESTAMP, coefficients VARCHAR(255) NOT NULL, lengthweightformula VARCHAR(255) NOT NULL, weightlengthformula VARCHAR(255) NOT NULL, meanlength NUMERIC, meanweight NUMERIC, sex VARCHAR(255) NOT NULL, code VARCHAR(255) DEFAULT 0, needcomment BOOLEAN DEFAULT FALSE, lastupdatedate TIMESTAMP DEFAULT now() NOT NULL, source VARCHAR(1025), sizemeasuretype VARCHAR(255) NOT NULL);
    
    45 45
     CREATE TABLE common.speciesgroupreleasemode(topiaid VARCHAR(255) NOT NULL CONSTRAINT pk_species_group_release_mode PRIMARY KEY, topiaversion BIGINT NOT NULL, topiacreatedate DATE NOT NULL, lastupdatedate TIMESTAMP NOT NULL, code VARCHAR(255), status INTEGER DEFAULT 1, needcomment BOOLEAN DEFAULT FALSE, uri VARCHAR(255), label1 VARCHAR(255), label2 VARCHAR(255), label3 VARCHAR(255), label4 VARCHAR(255), label5 VARCHAR(255), label6 VARCHAR(255), label7 VARCHAR(255), label8 VARCHAR(255));
    
    46 46
     CREATE TABLE common.specieslist(topiaid VARCHAR(255) NOT NULL CONSTRAINT pk_specieslist PRIMARY KEY, topiaversion BIGINT NOT NULL, topiacreatedate DATE NOT NULL, code VARCHAR(255), status INTEGER DEFAULT 1, uri VARCHAR(255), label1 VARCHAR(255), label2 VARCHAR(255), label3 VARCHAR(255), label4 VARCHAR(255), label5 VARCHAR(255), label6 VARCHAR(255), label7 VARCHAR(255), label8 VARCHAR(255), needcomment BOOLEAN DEFAULT FALSE, lastupdatedate TIMESTAMP DEFAULT now() NOT NULL);
    
    47 47
     CREATE TABLE common.vesselsizecategory(topiaid VARCHAR(255) NOT NULL CONSTRAINT pk_vesselsizecategory PRIMARY KEY, topiaversion BIGINT NOT NULL, topiacreatedate DATE NOT NULL, code VARCHAR(255), uri VARCHAR(255), status INTEGER DEFAULT 1, capacitylabel VARCHAR(255), gaugelabel VARCHAR(255), needcomment BOOLEAN DEFAULT FALSE, lastupdatedate TIMESTAMP DEFAULT now() NOT NULL);
    
    48 48
     CREATE TABLE common.vesseltype(topiaid VARCHAR(255) NOT NULL CONSTRAINT pk_vesseltype PRIMARY KEY, topiaversion BIGINT NOT NULL, topiacreatedate DATE NOT NULL, code VARCHAR(255), uri VARCHAR(255), status INTEGER DEFAULT 1, label1 VARCHAR(255), label2 VARCHAR(255), label3 VARCHAR(255), label4 VARCHAR(255), label5 VARCHAR(255), label6 VARCHAR(255), label7 VARCHAR(255), label8 VARCHAR(255), needcomment BOOLEAN DEFAULT FALSE, lastupdatedate TIMESTAMP DEFAULT now() NOT NULL);
    
    49
    -CREATE TABLE common.vessel(topiaid VARCHAR(255) NOT NULL CONSTRAINT pk_vessel PRIMARY KEY, topiaversion BIGINT NOT NULL, topiacreatedate DATE NOT NULL, code VARCHAR(255), keelcode INTEGER, fleetcountry INTEGER, changedate TIMESTAMP, yearservice INTEGER, length NUMERIC, capacity NUMERIC, power INTEGER, searchmaximum NUMERIC, uri VARCHAR(255), status INTEGER DEFAULT 1, comment VARCHAR(1025), label1 VARCHAR(255), label2 VARCHAR(255), label3 VARCHAR(255), label4 VARCHAR(255), label5 VARCHAR(255), label6 VARCHAR(255), label7 VARCHAR(255), label8 VARCHAR(255), flagcountry VARCHAR(255), vesseltype VARCHAR(255), vesselsizecategory VARCHAR(255), needcomment BOOLEAN DEFAULT FALSE, lastupdatedate TIMESTAMP DEFAULT now() NOT NULL, comid VARCHAR(255), ctoiid VARCHAR(255), iattcid VARCHAR(255), imoid VARCHAR(255), nationalid VARCHAR(255), radiocallsignid VARCHAR(255), tuviid VARCHAR(255), shipowner VARCHAR(255));
    
    49
    +CREATE TABLE common.vessel(topiaid VARCHAR(255) NOT NULL CONSTRAINT pk_vessel PRIMARY KEY, topiaversion BIGINT NOT NULL, topiacreatedate DATE NOT NULL, code VARCHAR(255), keelcode INTEGER, fleetcountry INTEGER, changedate TIMESTAMP, yearservice INTEGER, length NUMERIC, capacity NUMERIC, power INTEGER, searchmaximum NUMERIC, uri VARCHAR(255), status INTEGER DEFAULT 1, comment VARCHAR(1025), label1 VARCHAR(255), label2 VARCHAR(255), label3 VARCHAR(255), label4 VARCHAR(255), label5 VARCHAR(255), label6 VARCHAR(255), label7 VARCHAR(255), label8 VARCHAR(255), flagcountry VARCHAR(255), vesseltype VARCHAR(255), vesselsizecategory VARCHAR(255), needcomment BOOLEAN DEFAULT FALSE, lastupdatedate TIMESTAMP DEFAULT now() NOT NULL, comid VARCHAR(255), iotcId VARCHAR(255), iccat VARCHAR(255), imoid VARCHAR(255), nationalid VARCHAR(255), radiocallsignid VARCHAR(255), tuviid VARCHAR(255), shipowner VARCHAR(255));
    
    50 50
     CREATE TABLE common.weightmeasuremethod(topiaid VARCHAR(255) NOT NULL CONSTRAINT pk_weightmeasuremethod PRIMARY KEY, topiaversion BIGINT NOT NULL, topiacreatedate DATE NOT NULL, lastupdatedate TIMESTAMP NOT NULL, code VARCHAR(255), status INTEGER DEFAULT 1, needcomment BOOLEAN DEFAULT FALSE, uri VARCHAR(255), label1 VARCHAR(255), label2 VARCHAR(255), label3 VARCHAR(255), label4 VARCHAR(255), label5 VARCHAR(255), label6 VARCHAR(255), label7 VARCHAR(255), label8 VARCHAR(255));
    
    51 51
     CREATE TABLE common.weightmeasuretype(topiaid VARCHAR(255) NOT NULL CONSTRAINT pk_weightmeasuretype PRIMARY KEY, topiaversion BIGINT NOT NULL, topiacreatedate DATE NOT NULL, lastupdatedate TIMESTAMP NOT NULL, code VARCHAR(255), status INTEGER DEFAULT 1, needcomment BOOLEAN DEFAULT FALSE, uri VARCHAR(255), label1 VARCHAR(255), label2 VARCHAR(255), label3 VARCHAR(255), label4 VARCHAR(255), label5 VARCHAR(255), label6 VARCHAR(255), label7 VARCHAR(255), label8 VARCHAR(255));
    
    52 52
     CREATE TABLE common.wind(topiaid VARCHAR(255) NOT NULL CONSTRAINT pk_wind PRIMARY KEY, topiaversion BIGINT NOT NULL, topiacreatedate DATE NOT NULL, code VARCHAR(255), speedrange VARCHAR(255), waveheight VARCHAR(255), uri VARCHAR(255), status INTEGER DEFAULT 1, label1 VARCHAR(255), label2 VARCHAR(255), label3 VARCHAR(255), label4 VARCHAR(255), label5 VARCHAR(255), label6 VARCHAR(255), label7 VARCHAR(255), label8 VARCHAR(255), needcomment BOOLEAN DEFAULT FALSE, lastupdatedate TIMESTAMP DEFAULT now() NOT NULL);
    
    ... ... @@ -55,6 +55,14 @@ CREATE TABLE common.ocean_species(species VARCHAR(255) NOT NULL, ocean VARCHAR(2
    55 55
     CREATE TABLE common.speciesgroup_speciesgroupreleasemode(speciesgroup VARCHAR(255) NOT NULL, speciesgroupreleasemode VARCHAR(255) NOT NULL);
    
    56 56
     CREATE TABLE common.species_specieslist(specieslist VARCHAR(255) NOT NULL, species VARCHAR(255) NOT NULL);
    
    57 57
     
    
    58
    +
    
    59
    +DELETE FROM observe_common.LengthWeightParameter WHERE topiaId = 'fr.ird.observe.entities.referentiel.LengthWeightParameter#201008191245#0.299';
    
    60
    +DELETE FROM observe_common.LengthWeightParameter WHERE topiaId = 'fr.ird.observe.entities.referentiel.LengthWeightParameter#201008191245#0.158';
    
    61
    +DELETE FROM observe_common.LengthWeightParameter WHERE topiaId = 'fr.ird.observe.entities.referentiel.LengthWeightParameter#201008191245#0.157';
    
    62
    +DELETE FROM observe_common.LengthWeightParameter WHERE topiaId = 'fr.ird.observe.entities.referentiel.LengthWeightParameter#201008191245#0.298';
    
    63
    +UPDATE observe_common.LengthWeightParameter SET sizeMeasureType = 'fr.ird.observe.entities.referentiel.SizeMeasureType#1433499465700#0.0902433863375336' WHERE sizeMeasureType IS NULL;
    
    64
    +UPDATE observe_common.LengthWeightParameter SET coefficients = 'a=0.5:b=0.0' WHERE coefficients IS NULL;
    
    65
    +
    
    58 66
     INSERT INTO common.country(topiaid, topiaversion, topiacreatedate, code, uri, iso2code, iso3code, status, label1, label2, label3, label4, label5, label6, label7, label8, needcomment, lastupdatedate) SELECT topiaid, topiaversion, topiacreatedate, code, uri, iso2code, iso3code, status, label1, label2, label3, label4, label5, label6, label7, label8, needcomment, lastupdatedate FROM observe_common.country;
    
    59 67
     INSERT INTO common.dataquality(topiaid, topiaversion, topiacreatedate, lastupdatedate, code, status, needcomment, uri, label1, label2, label3, label4, label5, label6, label7, label8) SELECT topiaid, topiaversion, topiacreatedate, lastupdatedate, code, status, needcomment, uri, label1, label2, label3, label4, label5, label6, label7, label8 FROM observe_common.dataquality;
    
    60 68
     INSERT INTO common.fpazone(topiaid, topiaversion, topiacreatedate, code, status, uri, label1, label2, label3, label4, label5, label6, label7, label8, startdate, enddate, needcomment, lastupdatedate) SELECT topiaid, topiaversion, topiacreatedate, code, status, uri, label1, label2, label3, label4, label5, label6, label7, label8, startdate, enddate, needcomment, lastupdatedate FROM observe_common.fpazone;
    
    ... ... @@ -79,7 +87,7 @@ INSERT INTO common.speciesgroupreleasemode(topiaid, topiaversion, topiacreatedat
    79 87
     INSERT INTO common.specieslist(topiaid, topiaversion, topiacreatedate, code, status, uri, label1, label2, label3, label4, label5, label6, label7, label8, needcomment, lastupdatedate) SELECT topiaid, topiaversion, topiacreatedate, code, status, uri, label1, label2, label3, label4, label5, label6, label7, label8, needcomment, lastupdatedate FROM observe_common.specieslist;
    
    80 88
     INSERT INTO common.vesselsizecategory(topiaid, topiaversion, topiacreatedate, code, uri, status, capacitylabel, gaugelabel, needcomment, lastupdatedate) SELECT topiaid, topiaversion, topiacreatedate, code, uri, status, capacitylabel, gaugelabel, needcomment, lastupdatedate FROM observe_common.vesselsizecategory;
    
    81 89
     INSERT INTO common.vesseltype(topiaid, topiaversion, topiacreatedate, code, uri, status, label1, label2, label3, label4, label5, label6, label7, label8, needcomment, lastupdatedate) SELECT topiaid, topiaversion, topiacreatedate, code, uri, status, label1, label2, label3, label4, label5, label6, label7, label8, needcomment, lastupdatedate FROM observe_common.vesseltype;
    
    82
    -INSERT INTO common.vessel(topiaid, topiaversion, topiacreatedate, code, keelcode, fleetcountry, changedate, yearservice, length, capacity, power, searchmaximum, uri, status, comment, label1, label2, label3, label4, label5, label6, label7, label8, flagcountry, vesseltype, vesselsizecategory, needcomment, lastupdatedate, comid, ctoiid, iattcid, imoid, nationalid, radiocallsignid, tuviid, shipowner) SELECT topiaid, topiaversion, topiacreatedate, code, keelcode, fleetcountry, changedate, yearservice, length, capacity, power, searchmaximum, uri, status, comment, label1, label2, label3, label4, label5, label6, label7, label8, flagcountry, vesseltype, vesselsizecategory, needcomment, lastupdatedate, comid, ctoiid, iattcid, imoid, nationalid, radiocallsignid, tuviid, shipowner FROM observe_common.vessel;
    
    90
    +INSERT INTO common.vessel(topiaid, topiaversion, topiacreatedate, code, keelcode, fleetcountry, changedate, yearservice, length, capacity, power, searchmaximum, uri, status, comment, label1, label2, label3, label4, label5, label6, label7, label8, flagcountry, vesseltype, vesselsizecategory, needcomment, lastupdatedate, comid, iotcId, iccat, imoid, nationalid, radiocallsignid, tuviid, shipowner) SELECT topiaid, topiaversion, topiacreatedate, code, keelcode, fleetcountry, changedate, yearservice, length, capacity, power, searchmaximum, uri, status, comment, label1, label2, label3, label4, label5, label6, label7, label8, flagcountry, vesseltype, vesselsizecategory, needcomment, lastupdatedate, comid, ctoiid, iattcid, imoid, nationalid, radiocallsignid, tuviid, shipowner FROM observe_common.vessel;
    
    83 91
     INSERT INTO common.weightmeasuremethod(topiaid, topiaversion, topiacreatedate, lastupdatedate, code, status, needcomment, uri, label1, label2, label3, label4, label5, label6, label7, label8) SELECT topiaid, topiaversion, topiacreatedate, lastupdatedate, code, status, needcomment, uri, label1, label2, label3, label4, label5, label6, label7, label8 FROM observe_common.weightmeasuremethod;
    
    84 92
     INSERT INTO common.weightmeasuretype(topiaid, topiaversion, topiacreatedate, lastupdatedate, code, status, needcomment, uri, label1, label2, label3, label4, label5, label6, label7, label8) SELECT topiaid, topiaversion, topiacreatedate, lastupdatedate, code, status, needcomment, uri, label1, label2, label3, label4, label5, label6, label7, label8 FROM observe_common.weightmeasuretype;
    
    85 93
     INSERT INTO common.wind(topiaid, topiaversion, topiacreatedate, code, speedrange, waveheight, uri, status, label1, label2, label3, label4, label5, label6, label7, label8, needcomment, lastupdatedate) SELECT topiaid, topiaversion, topiacreatedate, code, speedrange, waveheight, uri, status, label1, label2, label3, label4, label5, label6, label7, label8, needcomment, lastupdatedate FROM observe_common.wind;
    

  • services-local/src/main/java/fr/ird/observe/services/local/service/actions/consolidate/ConsolidateDataServiceLocal.java
    ... ... @@ -668,6 +668,12 @@ public class ConsolidateDataServiceLocal extends ObserveServiceLocal implements
    668 668
                 log.error(String.format("No size measure type found for TargetLength (%s) will use the one of the species", lengthWeightComputable.getTopiaId()));
    
    669 669
                 inputSizeMeasureType = species.getSizeMeasureType();
    
    670 670
             }
    
    671
    +
    
    672
    +        if (inputSizeMeasureType == null) {
    
    673
    +            log.error(String.format("No size measure type found for Species (%s), can't continue!", species.getTopiaId()));
    
    674
    +            return;
    
    675
    +        }
    
    676
    +
    
    671 677
             Optional<LengthWeightParameter> optionalLengthWeightParameter = activityContext.findLengthWeightParameter(species, sex, inputSizeMeasureType);
    
    672 678
     
    
    673 679
             if (!optionalLengthWeightParameter.isPresent()) {
    

  • services-local/src/test/java/fr/ird/observe/services/local/entity/LengthWeightParemetersTest.java
    ... ... @@ -8,12 +8,12 @@
    8 8
      * it under the terms of the GNU General Public License as
    
    9 9
      * published by the Free Software Foundation, either version 3 of the
    
    10 10
      * License, or (at your option) any later version.
    
    11
    - * 
    
    11
    + *
    
    12 12
      * This program is distributed in the hope that it will be useful,
    
    13 13
      * but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    14 14
      * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    15 15
      * GNU General Public License for more details.
    
    16
    - * 
    
    16
    + *
    
    17 17
      * You should have received a copy of the GNU General Public
    
    18 18
      * License along with this program.  If not, see
    
    19 19
      * <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    ... ... @@ -23,22 +23,24 @@ package fr.ird.observe.services.local.entity;
    23 23
     
    
    24 24
     import com.opensymphony.xwork2.interceptor.annotations.After;
    
    25 25
     import fr.ird.observe.dto.referential.ReferenceStatus;
    
    26
    -import fr.ird.observe.entities.referential.common.LengthWeightParameter;
    
    26
    +import fr.ird.observe.entities.ObserveTopiaDaoSupplier;
    
    27
    +import fr.ird.observe.entities.ObserveTopiaPersistenceContext;
    
    27 28
     import fr.ird.observe.entities.referential.LengthWeightParameterNotFoundException;
    
    29
    +import fr.ird.observe.entities.referential.common.LengthWeightParameter;
    
    28 30
     import fr.ird.observe.entities.referential.common.LengthWeightParameterTopiaDao;
    
    29 31
     import fr.ird.observe.entities.referential.common.LengthWeightParameters;
    
    30 32
     import fr.ird.observe.entities.referential.common.Ocean;
    
    31 33
     import fr.ird.observe.entities.referential.common.OceanTopiaDao;
    
    32 34
     import fr.ird.observe.entities.referential.common.Sex;
    
    33 35
     import fr.ird.observe.entities.referential.common.SexTopiaDao;
    
    36
    +import fr.ird.observe.entities.referential.common.SizeMeasureType;
    
    37
    +import fr.ird.observe.entities.referential.common.SizeMeasureTypeTopiaDao;
    
    34 38
     import fr.ird.observe.entities.referential.common.Species;
    
    35 39
     import fr.ird.observe.entities.referential.common.SpeciesTopiaDao;
    
    36
    -import fr.ird.observe.entities.ObserveTopiaDaoSupplier;
    
    37
    -import fr.ird.observe.entities.ObserveTopiaPersistenceContext;
    
    38 40
     import fr.ird.observe.services.local.service.ServiceLocalTestSupport;
    
    39 41
     import fr.ird.observe.test.spi.CopyDatabaseConfiguration;
    
    40
    -import org.apache.logging.log4j.Logger;
    
    41 42
     import org.apache.logging.log4j.LogManager;
    
    43
    +import org.apache.logging.log4j.Logger;
    
    42 44
     import org.junit.Assert;
    
    43 45
     import org.junit.Before;
    
    44 46
     import org.junit.Test;
    
    ... ... @@ -64,6 +66,7 @@ public class LengthWeightParemetersTest extends ServiceLocalTestSupport {
    64 66
                                                           Species species,
    
    65 67
                                                           Ocean ocean,
    
    66 68
                                                           Sex sex,
    
    69
    +                                                      SizeMeasureType sizeMeasureType,
    
    67 70
                                                           Date startDate,
    
    68 71
                                                           Date endDate) {
    
    69 72
     
    
    ... ... @@ -72,6 +75,7 @@ public class LengthWeightParemetersTest extends ServiceLocalTestSupport {
    72 75
             entity.setSpecies(species);
    
    73 76
             entity.setSex(sex);
    
    74 77
             entity.setOcean(ocean);
    
    78
    +        entity.setSizeMeasureType(sizeMeasureType);
    
    75 79
             entity.setStartDate(startDate);
    
    76 80
             entity.setEndDate(endDate);
    
    77 81
             entity.setStatus(ReferenceStatus.enabled);
    
    ... ... @@ -92,6 +96,7 @@ public class LengthWeightParemetersTest extends ServiceLocalTestSupport {
    92 96
             SpeciesTopiaDao speciesDAO = persistenceContext.getCommonSpeciesDao();
    
    93 97
             OceanTopiaDao oceanDAO = persistenceContext.getCommonOceanDao();
    
    94 98
             SexTopiaDao sexDao = persistenceContext.getCommonSexDao();
    
    99
    +        SizeMeasureTypeTopiaDao sizeMeasureTypeDao = persistenceContext.getCommonSizeMeasureTypeDao();
    
    95 100
     
    
    96 101
             Optional<Species> optionalSpecies = Optional.ofNullable(speciesDAO.forFaoCodeEquals("ALB").tryFindUnique().orNull());
    
    97 102
             Assert.assertTrue("Could not find species with faoCode: DOL", optionalSpecies.isPresent());
    
    ... ... @@ -105,6 +110,10 @@ public class LengthWeightParemetersTest extends ServiceLocalTestSupport {
    105 110
             Optional<Sex> optionalFemaleSex = Optional.ofNullable(sexDao.forCodeEquals("2").tryFindUnique().orNull());
    
    106 111
             Assert.assertTrue("Could not find sex with code 2 (female)", optionalFemaleSex.isPresent());
    
    107 112
     
    
    113
    +        Optional<SizeMeasureType> optionalSizeMeasureType = Optional.ofNullable(sizeMeasureTypeDao.forCodeEquals("FL").tryFindUnique().orNull());
    
    114
    +        Assert.assertTrue("Could not find sizeMeasureType with code FL", optionalSizeMeasureType.isPresent());
    
    115
    +        SizeMeasureType sizeMeasureType = optionalSizeMeasureType.get();
    
    116
    +
    
    108 117
             Date firstStartDate = DateUtil.createDate(1, 1, 2010);
    
    109 118
             Date firstEndDate = DateUtil.createDate(31, 12, 2010);
    
    110 119
             Date secondStartDate = DateUtil.createDate(1, 1, 2011);
    
    ... ... @@ -123,13 +132,13 @@ public class LengthWeightParemetersTest extends ServiceLocalTestSupport {
    123 132
             Ocean indianOcean = optionalIndianOcean.orElse(null);
    
    124 133
     
    
    125 134
             // Ajout parametrage Male / Atlantique (2010)
    
    126
    -        createLengthWeightParameter(lengthWeightParameterDao, species, atlanticOcean, maleSex, firstStartDate, firstEndDate);
    
    135
    +        createLengthWeightParameter(lengthWeightParameterDao, species, atlanticOcean, maleSex, sizeMeasureType, firstStartDate, firstEndDate);
    
    127 136
             // Ajout parametrage Male / Atlantique (après 2010)
    
    128
    -        createLengthWeightParameter(lengthWeightParameterDao, species, atlanticOcean, maleSex, secondStartDate, null);
    
    137
    +        createLengthWeightParameter(lengthWeightParameterDao, species, atlanticOcean, maleSex, sizeMeasureType, secondStartDate, null);
    
    129 138
             // Ajout parametrage Male / Indien (2010)
    
    130
    -        createLengthWeightParameter(lengthWeightParameterDao, species, indianOcean, maleSex, firstStartDate, firstEndDate);
    
    139
    +        createLengthWeightParameter(lengthWeightParameterDao, species, indianOcean, maleSex, sizeMeasureType, firstStartDate, firstEndDate);
    
    131 140
             // Ajout parametrage Male / Indien (Après 2010)
    
    132
    -        createLengthWeightParameter(lengthWeightParameterDao, species, indianOcean, maleSex, secondStartDate, null);
    
    141
    +        createLengthWeightParameter(lengthWeightParameterDao, species, indianOcean, maleSex, sizeMeasureType, secondStartDate, null);
    
    133 142
     
    
    134 143
         }
    
    135 144
     
    
    ... ... @@ -149,6 +158,7 @@ public class LengthWeightParemetersTest extends ServiceLocalTestSupport {
    149 158
             SpeciesTopiaDao speciesDAO = persistenceContext.getCommonSpeciesDao();
    
    150 159
             OceanTopiaDao oceanDAO = persistenceContext.getCommonOceanDao();
    
    151 160
             SexTopiaDao sexDao = persistenceContext.getCommonSexDao();
    
    161
    +        SizeMeasureTypeTopiaDao sizeMeasureTypeDao = persistenceContext.getCommonSizeMeasureTypeDao();
    
    152 162
     
    
    153 163
             Optional<Species> optionalSpecies = Optional.ofNullable(speciesDAO.forFaoCodeEquals("ALB").tryFindUnique().orNull());
    
    154 164
             Assert.assertTrue("Could not find species with faoCode: DOL", optionalSpecies.isPresent());
    
    ... ... @@ -184,47 +194,52 @@ public class LengthWeightParemetersTest extends ServiceLocalTestSupport {
    184 194
             Ocean indianOcean = optionalIndianOcean.orElse(null);
    
    185 195
             Ocean pacificOcean = optionalPacificOcean.orElse(null);
    
    186 196
     
    
    187
    -        assertFoundLengthWeightParameter(persistenceContext, species, atlanticOcean, null, undeterminedSex, date2009, date1970);
    
    188
    -        assertFoundLengthWeightParameter(persistenceContext, species, atlanticOcean, undeterminedSex, undeterminedSex, date2009, date1970);
    
    189
    -        assertFoundLengthWeightParameter(persistenceContext, species, atlanticOcean, maleSex, undeterminedSex, date2009, date1970);
    
    190
    -        assertFoundLengthWeightParameter(persistenceContext, species, atlanticOcean, femaleSex, undeterminedSex, date2009, date1970);
    
    191 197
     
    
    192
    -        assertFoundLengthWeightParameter(persistenceContext, species, atlanticOcean, null, undeterminedSex, date2010, date1970);
    
    193
    -        assertFoundLengthWeightParameter(persistenceContext, species, atlanticOcean, undeterminedSex, undeterminedSex, date2010, date1970);
    
    194
    -        assertFoundLengthWeightParameter(persistenceContext, species, atlanticOcean, maleSex, maleSex, date2010, date2010);
    
    195
    -        assertFoundLengthWeightParameter(persistenceContext, species, atlanticOcean, femaleSex, undeterminedSex, date2010, date1970);
    
    198
    +        Optional<SizeMeasureType> optionalSizeMeasureType = Optional.ofNullable(sizeMeasureTypeDao.forCodeEquals("FL").tryFindUnique().orNull());
    
    199
    +        Assert.assertTrue("Could not find sizeMeasureType with code FL", optionalSizeMeasureType.isPresent());
    
    200
    +        SizeMeasureType sizeMeasureType = optionalSizeMeasureType.get();
    
    201
    +
    
    202
    +        assertFoundLengthWeightParameter(persistenceContext, species, atlanticOcean, null, undeterminedSex, date2009, date1970, sizeMeasureType);
    
    203
    +        assertFoundLengthWeightParameter(persistenceContext, species, atlanticOcean, undeterminedSex, undeterminedSex, date2009, date1970, sizeMeasureType);
    
    204
    +        assertFoundLengthWeightParameter(persistenceContext, species, atlanticOcean, maleSex, undeterminedSex, date2009, date1970, sizeMeasureType);
    
    205
    +        assertFoundLengthWeightParameter(persistenceContext, species, atlanticOcean, femaleSex, undeterminedSex, date2009, date1970, sizeMeasureType);
    
    206
    +
    
    207
    +        assertFoundLengthWeightParameter(persistenceContext, species, atlanticOcean, null, undeterminedSex, date2010, date1970, sizeMeasureType);
    
    208
    +        assertFoundLengthWeightParameter(persistenceContext, species, atlanticOcean, undeterminedSex, undeterminedSex, date2010, date1970, sizeMeasureType);
    
    209
    +        assertFoundLengthWeightParameter(persistenceContext, species, atlanticOcean, maleSex, maleSex, date2010, date2010, sizeMeasureType);
    
    210
    +        assertFoundLengthWeightParameter(persistenceContext, species, atlanticOcean, femaleSex, undeterminedSex, date2010, date1970, sizeMeasureType);
    
    196 211
     
    
    197
    -        assertFoundLengthWeightParameter(persistenceContext, species, atlanticOcean, null, undeterminedSex, date2011, date1970);
    
    198
    -        assertFoundLengthWeightParameter(persistenceContext, species, atlanticOcean, undeterminedSex, undeterminedSex, date2011, date1970);
    
    199
    -        assertFoundLengthWeightParameter(persistenceContext, species, atlanticOcean, maleSex, maleSex, date2011, date2011);
    
    200
    -        assertFoundLengthWeightParameter(persistenceContext, species, atlanticOcean, femaleSex, undeterminedSex, date2011, date1970);
    
    212
    +        assertFoundLengthWeightParameter(persistenceContext, species, atlanticOcean, null, undeterminedSex, date2011, date1970, sizeMeasureType);
    
    213
    +        assertFoundLengthWeightParameter(persistenceContext, species, atlanticOcean, undeterminedSex, undeterminedSex, date2011, date1970, sizeMeasureType);
    
    214
    +        assertFoundLengthWeightParameter(persistenceContext, species, atlanticOcean, maleSex, maleSex, date2011, date2011, sizeMeasureType);
    
    215
    +        assertFoundLengthWeightParameter(persistenceContext, species, atlanticOcean, femaleSex, undeterminedSex, date2011, date1970, sizeMeasureType);
    
    201 216
     
    
    202 217
             // this test is now working!!! since we manage now perfectly null-null date range
    
    203
    -        assertFoundLengthWeightParameter(persistenceContext, species, indianOcean, undeterminedSex, undeterminedSex, date2009, null);
    
    204
    -        assertFoundLengthWeightParameter(persistenceContext, species, indianOcean, undeterminedSex, undeterminedSex, date2009, null);
    
    205
    -        assertFoundLengthWeightParameter(persistenceContext, species, indianOcean, maleSex, undeterminedSex, date2009, null);
    
    206
    -        assertFoundLengthWeightParameter(persistenceContext, species, indianOcean, femaleSex, undeterminedSex, date2009, null);
    
    218
    +        assertFoundLengthWeightParameter(persistenceContext, species, indianOcean, undeterminedSex, undeterminedSex, date2009, null, sizeMeasureType);
    
    219
    +        assertFoundLengthWeightParameter(persistenceContext, species, indianOcean, undeterminedSex, undeterminedSex, date2009, null, sizeMeasureType);
    
    220
    +        assertFoundLengthWeightParameter(persistenceContext, species, indianOcean, maleSex, undeterminedSex, date2009, null, sizeMeasureType);
    
    221
    +        assertFoundLengthWeightParameter(persistenceContext, species, indianOcean, femaleSex, undeterminedSex, date2009, null, sizeMeasureType);
    
    207 222
     
    
    208
    -        assertFoundLengthWeightParameter(persistenceContext, species, indianOcean, undeterminedSex, undeterminedSex, date2010, null);
    
    209
    -        assertFoundLengthWeightParameter(persistenceContext, species, indianOcean, maleSex, maleSex, date2010, date2010);
    
    210
    -        assertFoundLengthWeightParameter(persistenceContext, species, indianOcean, femaleSex, undeterminedSex, date2010, null);
    
    223
    +        assertFoundLengthWeightParameter(persistenceContext, species, indianOcean, undeterminedSex, undeterminedSex, date2010, null, sizeMeasureType);
    
    224
    +        assertFoundLengthWeightParameter(persistenceContext, species, indianOcean, maleSex, maleSex, date2010, date2010, sizeMeasureType);
    
    225
    +        assertFoundLengthWeightParameter(persistenceContext, species, indianOcean, femaleSex, undeterminedSex, date2010, null, sizeMeasureType);
    
    211 226
     
    
    212
    -        assertFoundLengthWeightParameter(persistenceContext, species, indianOcean, undeterminedSex, undeterminedSex, date2011, null);
    
    213
    -        assertFoundLengthWeightParameter(persistenceContext, species, indianOcean, maleSex, maleSex, date2011, date2011);
    
    214
    -        assertFoundLengthWeightParameter(persistenceContext, species, indianOcean, femaleSex, undeterminedSex, date2011, null);
    
    227
    +        assertFoundLengthWeightParameter(persistenceContext, species, indianOcean, undeterminedSex, undeterminedSex, date2011, null, sizeMeasureType);
    
    228
    +        assertFoundLengthWeightParameter(persistenceContext, species, indianOcean, maleSex, maleSex, date2011, date2011, sizeMeasureType);
    
    229
    +        assertFoundLengthWeightParameter(persistenceContext, species, indianOcean, femaleSex, undeterminedSex, date2011, null, sizeMeasureType);
    
    215 230
     
    
    216
    -        assertNotFoundLengthWeightParameter(persistenceContext, species, pacificOcean, undeterminedSex, date2010);
    
    217
    -        assertNotFoundLengthWeightParameter(persistenceContext, species, pacificOcean, maleSex, date2010);
    
    218
    -        assertNotFoundLengthWeightParameter(persistenceContext, species, pacificOcean, femaleSex, date2010);
    
    231
    +        assertNotFoundLengthWeightParameter(persistenceContext, species, pacificOcean, undeterminedSex, date2010, sizeMeasureType);
    
    232
    +        assertNotFoundLengthWeightParameter(persistenceContext, species, pacificOcean, maleSex, date2010, sizeMeasureType);
    
    233
    +        assertNotFoundLengthWeightParameter(persistenceContext, species, pacificOcean, femaleSex, date2010, sizeMeasureType);
    
    219 234
     
    
    220 235
         }
    
    221 236
     
    
    222
    -    protected void assertFoundLengthWeightParameter(ObserveTopiaDaoSupplier supplier, Species species, Ocean ocean, Sex sex, Sex expectedSex, Date date, Date expectedStartDate) {
    
    237
    +    protected void assertFoundLengthWeightParameter(ObserveTopiaDaoSupplier supplier, Species species, Ocean ocean, Sex sex, Sex expectedSex, Date date, Date expectedStartDate, SizeMeasureType expectedSizeMeasureType) {
    
    223 238
     
    
    224 239
             if (log.isInfoEnabled()) {
    
    225 240
                 log.info("Try to find length weith parameter for species " + species.getFaoCode() + " - ocean " + ocean.getLabel1() + " - sex " + (sex == null ? "null" : sex.getLabel1()) + " at " + date);
    
    226 241
             }
    
    227
    -        LengthWeightParameter lengthWeightParameter = LengthWeightParameters.findLengthWeightParameter(supplier, species, sex, ocean, date, null);
    
    242
    +        LengthWeightParameter lengthWeightParameter = LengthWeightParameters.findLengthWeightParameter(supplier, species, sex, ocean, date, expectedSizeMeasureType);
    
    228 243
     
    
    229 244
             Assert.assertNotNull("length weith parameter not found for species " + species.getFaoCode() + " - ocean " + ocean.getLabel1() + " - sex " + (sex == null ? "null" : sex.getLabel1()) + " at " + date, lengthWeightParameter);
    
    230 245
             Assert.assertEquals("Expected sex is " + expectedSex.getLabel1() + " but the one found was " + lengthWeightParameter.getSex().getLabel1(), expectedSex, lengthWeightParameter.getSex());
    
    ... ... @@ -234,13 +249,13 @@ public class LengthWeightParemetersTest extends ServiceLocalTestSupport {
    234 249
             }
    
    235 250
         }
    
    236 251
     
    
    237
    -    protected void assertNotFoundLengthWeightParameter(ObserveTopiaDaoSupplier supplier, Species species, Ocean ocean, Sex sex, Date date) {
    
    252
    +    protected void assertNotFoundLengthWeightParameter(ObserveTopiaDaoSupplier supplier, Species species, Ocean ocean, Sex sex, Date date, SizeMeasureType expectedSizeMeasureType) {
    
    238 253
     
    
    239 254
             if (log.isInfoEnabled()) {
    
    240 255
                 log.info("Try to find length weith parameter for species " + species.getFaoCode() + " - ocean " + ocean.getLabel1() + " - sex " + (sex == null ? "null" : sex.getLabel1()) + " at " + date);
    
    241 256
             }
    
    242 257
             try {
    
    243
    -            LengthWeightParameters.findLengthWeightParameter(supplier, species, sex, ocean, date, null);
    
    258
    +            LengthWeightParameters.findLengthWeightParameter(supplier, species, sex, ocean, date, expectedSizeMeasureType);
    
    244 259
                 Assert.fail();
    
    245 260
             } catch (LengthWeightParameterNotFoundException e) {
    
    246 261
     
    

  • test/src/main/resources/db/8.0/dataForTestLongline.sql.gz
    No preview for this file type
  • test/src/main/resources/db/8.0/dataForTestSeine.sql.gz
    No preview for this file type
  • test/src/main/resources/db/8.0/empty_h2.sql.gz
    No preview for this file type
  • test/src/main/resources/db/8.0/empty_pg.sql.gz
    No preview for this file type
  • test/src/main/resources/db/8.0/referentiel.sql.gz
    No preview for this file type
  • test/src/main/resources/fixtures/count-referential-common.properties
    ... ... @@ -30,7 +30,7 @@ common.harbour=74
    30 30
     common.lastupdatedate=125
    
    31 31
     common.lengthlengthparameter=0
    
    32 32
     common.lengthmeasuremethod=4
    
    33
    -common.lengthweightparameter=365
    
    33
    +common.lengthweightparameter=361
    
    34 34
     common.ocean=3
    
    35 35
     common.ocean_species=500
    
    36 36
     common.organism=9
    

  • test/src/main/resources/fixtures/validate-service-referential.properties
    ... ... @@ -41,7 +41,7 @@ VesselTypeDto=3
    41 41
     SexDto=2
    
    42 42
     NonTargetCatchReleaseConformityDto=2
    
    43 43
     MaturityStatusDto=3
    
    44
    -LengthWeightParameterDto=4
    
    44
    +LengthWeightParameterDto=3
    
    45 45
     NonTargetCatchReleaseStatusDto=2
    
    46 46
     SurroundingActivityDto=3
    
    47 47
     ItemVerticalPositionDto=1