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.sale.ExpectedSale; 033import fr.ifremer.adagio.core.dao.data.survey.sale.Sale; 034import fr.ifremer.adagio.core.dao.referential.AnalysisInstrument; 035import fr.ifremer.adagio.core.dao.referential.NumericalPrecision; 036import fr.ifremer.adagio.core.dao.referential.PrecisionType; 037import fr.ifremer.adagio.core.dao.referential.QualityFlag; 038import fr.ifremer.adagio.core.dao.referential.pmfm.AggregationLevel; 039import fr.ifremer.adagio.core.dao.referential.pmfm.Pmfm; 040import fr.ifremer.adagio.core.dao.referential.pmfm.QualitativeValue; 041import java.util.Date; 042 043/** 044 * Caractéristiques sur la vente (données economiques, ou caractéristiques de l'observation, etc.). 045 */ 046// HibernateEntity.vsl annotations merge-point 047public abstract class SaleMeasurement 048 extends MeasurementImpl 049{ 050 /** 051 * The serial version UID of this class. Needed for serialization. 052 */ 053 private static final long serialVersionUID = -8531875261997866308L; 054 055 // Generate 0 attributes 056 // Generate 2 associations 057 private Sale sale; 058 059 /** 060 * Vente liée à un navire, effectuée en un lieu et une date données. Une vente regroupe 061 * plusieurs 062 * produits vendus (Produce). 063 * Attention : une vente est ponctuelle dans le temps. Si l'on souhaite recencer une vente qui 064 * s'étale 065 * sur plusieurs jours, 066 * @return this.sale Sale 067 */ 068 public Sale getSale() 069 { 070 return this.sale; 071 } 072 073 /** 074 * Vente liée à un navire, effectuée en un lieu et une date données. Une vente regroupe 075 * plusieurs 076 * produits vendus (Produce). 077 * Attention : une vente est ponctuelle dans le temps. Si l'on souhaite recencer une vente qui 078 * s'étale 079 * sur plusieurs jours, 080 * @param saleIn Sale 081 */ 082 public void setSale(Sale saleIn) 083 { 084 this.sale = saleIn; 085 } 086 087 private ExpectedSale expectedSale; 088 089 /** 090 * Mode de vente escompté (d’une marée observée ou d'un débarquement observé). 091 * @return this.expectedSale ExpectedSale 092 */ 093 public ExpectedSale getExpectedSale() 094 { 095 return this.expectedSale; 096 } 097 098 /** 099 * Mode de vente escompté (d’une marée observée ou d'un débarquement observé). 100 * @param expectedSaleIn ExpectedSale 101 */ 102 public void setExpectedSale(ExpectedSale expectedSaleIn) 103 { 104 this.expectedSale = expectedSaleIn; 105 } 106 107 /** 108 * This entity does not have any identifiers 109 * but since it extends the <code>MeasurementImpl</code> class 110 * it will simply delegate the call up there. 111 * 112 * @see fr.ifremer.adagio.core.dao.data.measure.Measurement#equals(Object) 113 */ 114 @Override 115 public boolean equals(Object object) 116 { 117 return super.equals(object); 118 } 119 120 /** 121 * This entity does not have any identifiers 122 * but since it extends the <code>MeasurementImpl</code> class 123 * it will simply delegate the call up there. 124 * 125 * @see fr.ifremer.adagio.core.dao.data.measure.Measurement#hashCode() 126 */ 127 @Override 128 public int hashCode() 129 { 130 return super.hashCode(); 131 } 132 133 /** 134 * Constructs new instances of {@link SaleMeasurement}. 135 */ 136 public static final class Factory 137 { 138 /** 139 * Constructs a new instance of {@link SaleMeasurement}. 140 * @return new SaleMeasurementImpl() 141 */ 142 public static SaleMeasurement newInstance() 143 { 144 return new SaleMeasurementImpl(); 145 } 146 147 /** 148 * Constructs a new instance of {@link SaleMeasurement}, taking all required and/or 149 * read-only properties as arguments, except for identifiers. 150 * @param qualityFlag QualityFlag 151 * @param pmfm Pmfm 152 * @return newInstance 153 */ 154 public static SaleMeasurement newInstance(QualityFlag qualityFlag, Pmfm pmfm) 155 { 156 final SaleMeasurement entity = new SaleMeasurementImpl(); 157 entity.setQualityFlag(qualityFlag); 158 entity.setPmfm(pmfm); 159 return entity; 160 } 161 162 /** 163 * Constructs a new instance of {@link SaleMeasurement}, taking all possible properties 164 * (except the identifier(s))as arguments. 165 * @param numericalValue Float 166 * @param alphanumericalValue String 167 * @param digitCount Integer 168 * @param precisionValue Float 169 * @param controlDate Date 170 * @param validationDate Date 171 * @param qualificationDate Date 172 * @param qualificationComments String 173 * @param aggregationLevel AggregationLevel 174 * @param qualitativeValue QualitativeValue 175 * @param qualityFlag QualityFlag 176 * @param precisionType PrecisionType 177 * @param analysisInstrument AnalysisInstrument 178 * @param pmfm Pmfm 179 * @param department Department 180 * @param numericalPrecision NumericalPrecision 181 * @param sale Sale 182 * @param expectedSale ExpectedSale 183 * @return newInstance SaleMeasurement 184 */ 185 public static SaleMeasurement 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, Sale sale, ExpectedSale expectedSale) 186 { 187 final SaleMeasurement entity = new SaleMeasurementImpl(); 188 entity.setNumericalValue(numericalValue); 189 entity.setAlphanumericalValue(alphanumericalValue); 190 entity.setDigitCount(digitCount); 191 entity.setPrecisionValue(precisionValue); 192 entity.setControlDate(controlDate); 193 entity.setValidationDate(validationDate); 194 entity.setQualificationDate(qualificationDate); 195 entity.setQualificationComments(qualificationComments); 196 entity.setAggregationLevel(aggregationLevel); 197 entity.setQualitativeValue(qualitativeValue); 198 entity.setQualityFlag(qualityFlag); 199 entity.setPrecisionType(precisionType); 200 entity.setAnalysisInstrument(analysisInstrument); 201 entity.setPmfm(pmfm); 202 entity.setDepartment(department); 203 entity.setNumericalPrecision(numericalPrecision); 204 entity.setSale(sale); 205 entity.setExpectedSale(expectedSale); 206 return entity; 207 } 208 } 209 210 /** 211 * @see Comparable#compareTo 212 */ 213 public int compareTo(SaleMeasurement o) 214 { 215 int cmp = 0; 216 if (this.getId() != null) 217 { 218 cmp = this.getId().compareTo(o.getId()); 219 } 220 return cmp; 221 } 222// HibernateEntity.vsl merge-point 223// SaleMeasurement.java merge-point 224}