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.qualification; 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.data.history.ProcessingHistory; 032import fr.ifremer.adagio.core.dao.referential.QualityFlag; 033import fr.ifremer.adagio.core.dao.referential.qualification.QualificationRule; 034import java.io.Serializable; 035 036/** 037 * Règle de qualification qui a été appliquée, sur une donnée. 038 */ 039// HibernateEntity.vsl annotations merge-point 040public abstract class AppliedQualificationRule 041 implements Serializable, Comparable<AppliedQualificationRule> 042{ 043 /** 044 * The serial version UID of this class. Needed for serialization. 045 */ 046 private static final long serialVersionUID = -3208140398934180054L; 047 048 // Generate 2 attributes 049 private Integer id; 050 051 /** 052 * Idenfiant interne. Généré par le système. 053 * @return this.id Integer 054 */ 055 public Integer getId() 056 { 057 return this.id; 058 } 059 060 /** 061 * Idenfiant interne. Généré par le système. 062 * @param idIn Integer 063 */ 064 public void setId(Integer idIn) 065 { 066 this.id = idIn; 067 } 068 069 private String message; 070 071 /** 072 * 073 * @return this.message String 074 */ 075 public String getMessage() 076 { 077 return this.message; 078 } 079 080 /** 081 * 082 * @param messageIn String 083 */ 084 public void setMessage(String messageIn) 085 { 086 this.message = messageIn; 087 } 088 089 // Generate 4 associations 090 private ProcessingHistory processingHistory; 091 092 /** 093 * <html> 094 * <head> 095 * <style> 096 * p {padding:0px; margin:0px;} 097 * </style> 098 * </head> 099 * <body> 100 * <p> 101 * Historique des traitements, qu’il s’agisse de flux (comme historiquement 102 * la table HIS_FLUX) ou non (traitement d’agrégation, CQ auto, etc.). 103 * </p> 104 * <p> 105 * </p> 106 * <p style="font-family:Times New 107 * Roman,serif;margin-bottom:.0001pt;margin-left:0cm;margin-top:0cm;font-size:12.0pt;"> 108 * Permet donc de conserver l'historique des traitements qui se sont 109 * exécutés sur le système, notamment ceux qui ont impactés la base de 110 * données brutes (Adagio). 111 * </p> 112 * <p style="font-family:Times New 113 * Roman,serif;margin-bottom:.0001pt;margin-left:0cm;margin-top:0cm;font-size:12.0pt;"> 114 * </p> 115 * <p style="font-family:Times New 116 * Roman,serif;margin-bottom:.0001pt;margin-left:0cm;margin-top:0cm;font-size:12.0pt;"> 117 * L’exécution des traitements en erreur peuvent également être tracée. 118 * </p> 119 * </body> 120 * </html> 121 * @return this.processingHistory ProcessingHistory 122 */ 123 public ProcessingHistory getProcessingHistory() 124 { 125 return this.processingHistory; 126 } 127 128 /** 129 * <html> 130 * <head> 131 * <style> 132 * p {padding:0px; margin:0px;} 133 * </style> 134 * </head> 135 * <body> 136 * <p> 137 * Historique des traitements, qu’il s’agisse de flux (comme historiquement 138 * la table HIS_FLUX) ou non (traitement d’agrégation, CQ auto, etc.). 139 * </p> 140 * <p> 141 * </p> 142 * <p style="font-family:Times New 143 * Roman,serif;margin-bottom:.0001pt;margin-left:0cm;margin-top:0cm;font-size:12.0pt;"> 144 * Permet donc de conserver l'historique des traitements qui se sont 145 * exécutés sur le système, notamment ceux qui ont impactés la base de 146 * données brutes (Adagio). 147 * </p> 148 * <p style="font-family:Times New 149 * Roman,serif;margin-bottom:.0001pt;margin-left:0cm;margin-top:0cm;font-size:12.0pt;"> 150 * </p> 151 * <p style="font-family:Times New 152 * Roman,serif;margin-bottom:.0001pt;margin-left:0cm;margin-top:0cm;font-size:12.0pt;"> 153 * L’exécution des traitements en erreur peuvent également être tracée. 154 * </p> 155 * </body> 156 * </html> 157 * @param processingHistoryIn ProcessingHistory 158 */ 159 public void setProcessingHistory(ProcessingHistory processingHistoryIn) 160 { 161 this.processingHistory = processingHistoryIn; 162 } 163 164 private QualifiedItem qualifiedItem; 165 166 /** 167 * Représente la donnée qui a été qualifiée, par une plusieurs règles de qualification. 168 * @return this.qualifiedItem QualifiedItem 169 */ 170 public QualifiedItem getQualifiedItem() 171 { 172 return this.qualifiedItem; 173 } 174 175 /** 176 * Représente la donnée qui a été qualifiée, par une plusieurs règles de qualification. 177 * @param qualifiedItemIn QualifiedItem 178 */ 179 public void setQualifiedItem(QualifiedItem qualifiedItemIn) 180 { 181 this.qualifiedItem = qualifiedItemIn; 182 } 183 184 private QualityFlag qualityFlag; 185 186 /** 187 * Indice qualité d'une donnée. 188 * Actuellement, les indices qualités identifiés sont : 189 * 0 - Non qualifiée, 190 * 1 - Bonne, 191 * 2 - Hors statistiques, 192 * 3 - Douteuse, 193 * 4 - Fausse, 194 * 5 - Corrigée, 195 * 8 - Incomplète, 196 * 9 - Absente. 197 * @return this.qualityFlag QualityFlag 198 */ 199 public QualityFlag getQualityFlag() 200 { 201 return this.qualityFlag; 202 } 203 204 /** 205 * Indice qualité d'une donnée. 206 * Actuellement, les indices qualités identifiés sont : 207 * 0 - Non qualifiée, 208 * 1 - Bonne, 209 * 2 - Hors statistiques, 210 * 3 - Douteuse, 211 * 4 - Fausse, 212 * 5 - Corrigée, 213 * 8 - Incomplète, 214 * 9 - Absente. 215 * @param qualityFlagIn QualityFlag 216 */ 217 public void setQualityFlag(QualityFlag qualityFlagIn) 218 { 219 this.qualityFlag = qualityFlagIn; 220 } 221 222 private QualificationRule qualificationRule; 223 224 /** 225 * Règle de qualification automatique 226 * @return this.qualificationRule QualificationRule 227 */ 228 public QualificationRule getQualificationRule() 229 { 230 return this.qualificationRule; 231 } 232 233 /** 234 * Règle de qualification automatique 235 * @param qualificationRuleIn QualificationRule 236 */ 237 public void setQualificationRule(QualificationRule qualificationRuleIn) 238 { 239 this.qualificationRule = qualificationRuleIn; 240 } 241 242 /** 243 * Returns <code>true</code> if the argument is an AppliedQualificationRule instance and all identifiers for this entity 244 * equal the identifiers of the argument entity. Returns <code>false</code> otherwise. 245 */ 246 @Override 247 public boolean equals(Object object) 248 { 249 if (this == object) 250 { 251 return true; 252 } 253 if (!(object instanceof AppliedQualificationRule)) 254 { 255 return false; 256 } 257 final AppliedQualificationRule that = (AppliedQualificationRule)object; 258 if (this.id == null || that.getId() == null || !this.id.equals(that.getId())) 259 { 260 return false; 261 } 262 return true; 263 } 264 265 /** 266 * Returns a hash code based on this entity's identifiers. 267 */ 268 @Override 269 public int hashCode() 270 { 271 int hashCode = 0; 272 hashCode = 29 * hashCode + (this.id == null ? 0 : this.id.hashCode()); 273 274 return hashCode; 275 } 276 277 /** 278 * Constructs new instances of {@link AppliedQualificationRule}. 279 */ 280 public static final class Factory 281 { 282 /** 283 * Constructs a new instance of {@link AppliedQualificationRule}. 284 * @return new AppliedQualificationRuleImpl() 285 */ 286 public static AppliedQualificationRule newInstance() 287 { 288 return new AppliedQualificationRuleImpl(); 289 } 290 291 292 /** 293 * Constructs a new instance of {@link AppliedQualificationRule}, taking all possible properties 294 * (except the identifier(s))as arguments. 295 * @param message String 296 * @param processingHistory ProcessingHistory 297 * @param qualifiedItem QualifiedItem 298 * @param qualityFlag QualityFlag 299 * @param qualificationRule QualificationRule 300 * @return newInstance AppliedQualificationRule 301 */ 302 public static AppliedQualificationRule newInstance(String message, ProcessingHistory processingHistory, QualifiedItem qualifiedItem, QualityFlag qualityFlag, QualificationRule qualificationRule) 303 { 304 final AppliedQualificationRule entity = new AppliedQualificationRuleImpl(); 305 entity.setMessage(message); 306 entity.setProcessingHistory(processingHistory); 307 entity.setQualifiedItem(qualifiedItem); 308 entity.setQualityFlag(qualityFlag); 309 entity.setQualificationRule(qualificationRule); 310 return entity; 311 } 312 } 313 314 /** 315 * @see Comparable#compareTo 316 */ 317 public int compareTo(AppliedQualificationRule o) 318 { 319 int cmp = 0; 320 if (this.getId() != null) 321 { 322 cmp = this.getId().compareTo(o.getId()); 323 } 324 else 325 { 326 if (this.getMessage() != null) 327 { 328 cmp = (cmp != 0 ? cmp : this.getMessage().compareTo(o.getMessage())); 329 } 330 } 331 return cmp; 332 } 333// HibernateEntity.vsl merge-point 334// AppliedQualificationRule.java merge-point 335}