001// license-header java merge-point 002// 003// Attention: Generated code! Do not modify by hand! 004// Generated by: hibernate/HibernateEntity.vsl in andromda-hibernate-cartridge. 005// 006package fr.ifremer.adagio.core.dao.data.measure; 007 008/* 009 * #%L 010 * SIH-Adagio :: Core 011 * $Id:$ 012 * $HeadURL:$ 013 * %% 014 * Copyright (C) 2012 - 2014 Ifremer 015 * %% 016 * This program is free software: you can redistribute it and/or modify 017 * it under the terms of the GNU Affero General Public License as published by 018 * the Free Software Foundation, either version 3 of the License, or 019 * (at your option) any later version. 020 * 021 * This program is distributed in the hope that it will be useful, 022 * but WITHOUT ANY WARRANTY; without even the implied warranty of 023 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 024 * GNU General Public License for more details. 025 * 026 * You should have received a copy of the GNU Affero General Public License 027 * along with this program. If not, see <http://www.gnu.org/licenses/>. 028 * #L% 029 */ 030 031import fr.ifremer.adagio.core.dao.administration.user.Department; 032import fr.ifremer.adagio.core.dao.data.produce.Produce; 033import fr.ifremer.adagio.core.dao.referential.AnalysisInstrument; 034import fr.ifremer.adagio.core.dao.referential.NumericalPrecision; 035import fr.ifremer.adagio.core.dao.referential.PrecisionType; 036import fr.ifremer.adagio.core.dao.referential.QualityFlag; 037import fr.ifremer.adagio.core.dao.referential.pmfm.AggregationLevel; 038import fr.ifremer.adagio.core.dao.referential.pmfm.Pmfm; 039import fr.ifremer.adagio.core.dao.referential.pmfm.QualitativeValue; 040import java.util.Date; 041 042/** 043 * <html> 044 * <head> 045 * <style> 046 * p {padding:0px; margin:0px;} 047 * </style> 048 * </head> 049 * <body> 050 * <p> 051 * Résultat de mesure de quantification d'un produit. 052 * </p> 053 * <p> 054 * </p> 055 * <p> 056 * Les mesures de quantification portent sur le paramètre "Poids". Un poids 057 * peut être obtenu par différentes méthodes (cf <i>Method</i> 058 * liée au <i>Pmfm</i>) : 059 * </p> 060 * <p> 061 * - mesuré (ex : par une règle ou Ichtyomètre), 062 * </p> 063 * <p> 064 * - estimé (ex : jugement par un expert), 065 * </p> 066 * <p> 067 * - calculé par une relation taille/poids 068 * </p> 069 * <p> 070 * - calculé à partir de volumes (nombre d'unité de volume x Poids d'une 071 * unité de volume). Il s'agit donc d'un poids estimé, mais par le volume. 072 * </p> 073 * <p> 074 * - déclaré (cf SACROIS/RIC2) 075 * </p> 076 * </body> 077 * </html> 078 */ 079// HibernateEntity.vsl annotations merge-point 080public abstract class ProduceQuantificationMeasurement 081 extends MeasurementImpl 082{ 083 /** 084 * The serial version UID of this class. Needed for serialization. 085 */ 086 private static final long serialVersionUID = -5467150937143605617L; 087 088 // Generate 2 attributes 089 private Short subgroupNumber; 090 091 /** 092 * Numéro du sous ensemble sur lequel porte la mesure de quantification. Si non renseigné, le 093 * mesure porte sur tout le lot rattaché.Une quantification d'un lot peut faire intervenir 094 * plusieurs sous-ensemble sur lequel des mesures sont éffectuées. Par exemple, plusieurs 095 * sous-ensembles peuvent être quantifié par pesée, chaque mesure est donc rattaché à un 096 * sous-ensemmble, via le numéro de sous ensemble. 097 * @return this.subgroupNumber Short 098 */ 099 public Short getSubgroupNumber() 100 { 101 return this.subgroupNumber; 102 } 103 104 /** 105 * Numéro du sous ensemble sur lequel porte la mesure de quantification. Si non renseigné, le 106 * mesure porte sur tout le lot rattaché.Une quantification d'un lot peut faire intervenir 107 * plusieurs sous-ensemble sur lequel des mesures sont éffectuées. Par exemple, plusieurs 108 * sous-ensembles peuvent être quantifié par pesée, chaque mesure est donc rattaché à un 109 * sous-ensemmble, via le numéro de sous ensemble. 110 * @param subgroupNumberIn Short 111 */ 112 public void setSubgroupNumber(Short subgroupNumberIn) 113 { 114 this.subgroupNumber = subgroupNumberIn; 115 } 116 117 private Boolean isReferenceQuantification; 118 119 /** 120 * S'agit t il de la mesure de référence pour la quantification du lot ? Par défaut, le poids 121 * calculé (par relation taille/poids) est le poids de référence. 122 * Doit etre NULL si subgroupNumber est NULL (un poids de référence ne peut pas porter sur une 123 * sous-ensemble du lot , mais sur tout le lot) 124 * @return this.isReferenceQuantification Boolean 125 */ 126 public Boolean getIsReferenceQuantification() 127 { 128 return this.isReferenceQuantification; 129 } 130 131 /** 132 * S'agit t il de la mesure de référence pour la quantification du lot ? Par défaut, le poids 133 * calculé (par relation taille/poids) est le poids de référence. 134 * Doit etre NULL si subgroupNumber est NULL (un poids de référence ne peut pas porter sur une 135 * sous-ensemble du lot , mais sur tout le lot) 136 * @param isReferenceQuantificationIn Boolean 137 */ 138 public void setIsReferenceQuantification(Boolean isReferenceQuantificationIn) 139 { 140 this.isReferenceQuantification = isReferenceQuantificationIn; 141 } 142 143 // Generate 1 associations 144 private Produce produce; 145 146 /** 147 * <html> 148 * <head> 149 * </head> 150 * <body> 151 * <p> 152 * Un produit est identifié par une espèce commerciale, un état, une 153 * qualité, présentation et catégorie commerciale. 154 * </p> 155 * <p> 156 * </p> 157 * <p> 158 * <u>Si le produit est un "produit vendu" :</u> 159 * </p> 160 * <p> 161 * On pourra allors utiliser SortingMeasurement pour stocker des données 162 * économiques, comme par exemple : 163 * </p> 164 * <p> 165 * - Le prix du produit. Il peut y avoir plusieurds prix (plusieurs PSFMs), 166 * par exemple : prix au kilo, et prix total en euros. 167 * </p> 168 * <p> 169 * - Valorisation de la commercialisation : Label rouge, Eco Label, marque 170 * collective controlée par un organisme tier. (cf SACROIS) 171 * </p> 172 * <p> 173 * - Destination commerciale : consommation humaine, consommation animale, 174 * etc . 175 * </p> 176 * </body> 177 * </html> 178 * @return this.produce Produce 179 */ 180 public Produce getProduce() 181 { 182 return this.produce; 183 } 184 185 /** 186 * <html> 187 * <head> 188 * </head> 189 * <body> 190 * <p> 191 * Un produit est identifié par une espèce commerciale, un état, une 192 * qualité, présentation et catégorie commerciale. 193 * </p> 194 * <p> 195 * </p> 196 * <p> 197 * <u>Si le produit est un "produit vendu" :</u> 198 * </p> 199 * <p> 200 * On pourra allors utiliser SortingMeasurement pour stocker des données 201 * économiques, comme par exemple : 202 * </p> 203 * <p> 204 * - Le prix du produit. Il peut y avoir plusieurds prix (plusieurs PSFMs), 205 * par exemple : prix au kilo, et prix total en euros. 206 * </p> 207 * <p> 208 * - Valorisation de la commercialisation : Label rouge, Eco Label, marque 209 * collective controlée par un organisme tier. (cf SACROIS) 210 * </p> 211 * <p> 212 * - Destination commerciale : consommation humaine, consommation animale, 213 * etc . 214 * </p> 215 * </body> 216 * </html> 217 * @param produceIn Produce 218 */ 219 public void setProduce(Produce produceIn) 220 { 221 this.produce = produceIn; 222 } 223 224 /** 225 * This entity does not have any identifiers 226 * but since it extends the <code>MeasurementImpl</code> class 227 * it will simply delegate the call up there. 228 * 229 * @see fr.ifremer.adagio.core.dao.data.measure.Measurement#equals(Object) 230 */ 231 @Override 232 public boolean equals(Object object) 233 { 234 return super.equals(object); 235 } 236 237 /** 238 * This entity does not have any identifiers 239 * but since it extends the <code>MeasurementImpl</code> class 240 * it will simply delegate the call up there. 241 * 242 * @see fr.ifremer.adagio.core.dao.data.measure.Measurement#hashCode() 243 */ 244 @Override 245 public int hashCode() 246 { 247 return super.hashCode(); 248 } 249 250 /** 251 * Constructs new instances of {@link ProduceQuantificationMeasurement}. 252 */ 253 public static final class Factory 254 { 255 /** 256 * Constructs a new instance of {@link ProduceQuantificationMeasurement}. 257 * @return new ProduceQuantificationMeasurementImpl() 258 */ 259 public static ProduceQuantificationMeasurement newInstance() 260 { 261 return new ProduceQuantificationMeasurementImpl(); 262 } 263 264 /** 265 * Constructs a new instance of {@link ProduceQuantificationMeasurement}, taking all required and/or 266 * read-only properties as arguments, except for identifiers. 267 * @param qualityFlag QualityFlag 268 * @param pmfm Pmfm 269 * @param produce Produce 270 * @return newInstance 271 */ 272 public static ProduceQuantificationMeasurement newInstance(QualityFlag qualityFlag, Pmfm pmfm, Produce produce) 273 { 274 final ProduceQuantificationMeasurement entity = new ProduceQuantificationMeasurementImpl(); 275 entity.setQualityFlag(qualityFlag); 276 entity.setPmfm(pmfm); 277 entity.setProduce(produce); 278 return entity; 279 } 280 281 /** 282 * Constructs a new instance of {@link ProduceQuantificationMeasurement}, taking all possible properties 283 * (except the identifier(s))as arguments. 284 * @param numericalValue Float 285 * @param alphanumericalValue String 286 * @param digitCount Integer 287 * @param precisionValue Float 288 * @param controlDate Date 289 * @param validationDate Date 290 * @param qualificationDate Date 291 * @param qualificationComments String 292 * @param aggregationLevel AggregationLevel 293 * @param qualitativeValue QualitativeValue 294 * @param qualityFlag QualityFlag 295 * @param precisionType PrecisionType 296 * @param analysisInstrument AnalysisInstrument 297 * @param pmfm Pmfm 298 * @param department Department 299 * @param numericalPrecision NumericalPrecision 300 * @param subgroupNumber Short 301 * @param isReferenceQuantification Boolean 302 * @param produce Produce 303 * @return newInstance ProduceQuantificationMeasurement 304 */ 305 public static ProduceQuantificationMeasurement newInstance(Float numericalValue, String alphanumericalValue, Integer digitCount, Float precisionValue, Date controlDate, Date validationDate, Date qualificationDate, String qualificationComments, AggregationLevel aggregationLevel, QualitativeValue qualitativeValue, QualityFlag qualityFlag, PrecisionType precisionType, AnalysisInstrument analysisInstrument, Pmfm pmfm, Department department, NumericalPrecision numericalPrecision, Short subgroupNumber, Boolean isReferenceQuantification, Produce produce) 306 { 307 final ProduceQuantificationMeasurement entity = new ProduceQuantificationMeasurementImpl(); 308 entity.setNumericalValue(numericalValue); 309 entity.setAlphanumericalValue(alphanumericalValue); 310 entity.setDigitCount(digitCount); 311 entity.setPrecisionValue(precisionValue); 312 entity.setControlDate(controlDate); 313 entity.setValidationDate(validationDate); 314 entity.setQualificationDate(qualificationDate); 315 entity.setQualificationComments(qualificationComments); 316 entity.setAggregationLevel(aggregationLevel); 317 entity.setQualitativeValue(qualitativeValue); 318 entity.setQualityFlag(qualityFlag); 319 entity.setPrecisionType(precisionType); 320 entity.setAnalysisInstrument(analysisInstrument); 321 entity.setPmfm(pmfm); 322 entity.setDepartment(department); 323 entity.setNumericalPrecision(numericalPrecision); 324 entity.setSubgroupNumber(subgroupNumber); 325 entity.setIsReferenceQuantification(isReferenceQuantification); 326 entity.setProduce(produce); 327 return entity; 328 } 329 } 330 331 /** 332 * @see Comparable#compareTo 333 */ 334 public int compareTo(ProduceQuantificationMeasurement o) 335 { 336 int cmp = 0; 337 if (this.getId() != null) 338 { 339 cmp = this.getId().compareTo(o.getId()); 340 } 341 else 342 { 343 if (this.getSubgroupNumber() != null) 344 { 345 cmp = (cmp != 0 ? cmp : this.getSubgroupNumber().compareTo(o.getSubgroupNumber())); 346 } 347 if (this.getIsReferenceQuantification() != null) 348 { 349 cmp = (cmp != 0 ? cmp : this.getIsReferenceQuantification().compareTo(o.getIsReferenceQuantification())); 350 } 351 } 352 return cmp; 353 } 354// HibernateEntity.vsl merge-point 355// ProduceQuantificationMeasurement.java merge-point 356}