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.referential; 007 008/* 009 * #%L 010 * SIH-Adagio :: Core for Allegro 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 java.io.Serializable; 032import java.sql.Timestamp; 033 034/** 035 * Précision de la mesure par rapport au seuil de détection de l'instrument d'analyse. Se 036 * trouve-t-on au dessus ou en dessous du seuil de détection ? 037 * Utilisée principalement lors de l'utilisation d'instrument de mesure. 038 * La liste sera la suivante : 039 * - supérieure valeur maximale pouvant être détectée 040 * - inférieure à la valeur minimale pouvant être détectée 041 */ 042// HibernateEntity.vsl annotations merge-point 043public abstract class NumericalPrecision 044 implements Serializable, Comparable<NumericalPrecision> 045{ 046 /** 047 * The serial version UID of this class. Needed for serialization. 048 */ 049 private static final long serialVersionUID = -8831090070803521991L; 050 051 // Generate 4 attributes 052 private Integer id; 053 054 /** 055 * Idenfiant interne. Généré par le système. 056 * @return this.id Integer 057 */ 058 public Integer getId() 059 { 060 return this.id; 061 } 062 063 /** 064 * Idenfiant interne. Généré par le système. 065 * @param idIn Integer 066 */ 067 public void setId(Integer idIn) 068 { 069 this.id = idIn; 070 } 071 072 private String name; 073 074 /** 075 * 076 * @return this.name String 077 */ 078 public String getName() 079 { 080 return this.name; 081 } 082 083 /** 084 * 085 * @param nameIn String 086 */ 087 public void setName(String nameIn) 088 { 089 this.name = nameIn; 090 } 091 092 private String description; 093 094 /** 095 * 096 * @return this.description String 097 */ 098 public String getDescription() 099 { 100 return this.description; 101 } 102 103 /** 104 * 105 * @param descriptionIn String 106 */ 107 public void setDescription(String descriptionIn) 108 { 109 this.description = descriptionIn; 110 } 111 112 private Timestamp updateDate; 113 114 /** 115 * 116 * @return this.updateDate Timestamp 117 */ 118 public Timestamp getUpdateDate() 119 { 120 return this.updateDate; 121 } 122 123 /** 124 * 125 * @param updateDateIn Timestamp 126 */ 127 public void setUpdateDate(Timestamp updateDateIn) 128 { 129 this.updateDate = updateDateIn; 130 } 131 132 // Generate 2 associations 133 private Status status; 134 135 /** 136 * Pour les données du référentiel, information permettant de déterminer si une donnée est 137 * valide, 138 * obsolète ou temporaire. 139 * - obsolète (=inactif) : '0' 140 * - valide (=actif) : '1' 141 * - temporaire : '2' 142 * note : on a préfère ici 'valide' au terme 'actif' (utilisé dans Harmonie), pour ne pas 143 * confondre 144 * avec par exemple l'activité d'un navire sur un mois. 145 * @return this.status Status 146 */ 147 public Status getStatus() 148 { 149 return this.status; 150 } 151 152 /** 153 * Pour les données du référentiel, information permettant de déterminer si une donnée est 154 * valide, 155 * obsolète ou temporaire. 156 * - obsolète (=inactif) : '0' 157 * - valide (=actif) : '1' 158 * - temporaire : '2' 159 * note : on a préfère ici 'valide' au terme 'actif' (utilisé dans Harmonie), pour ne pas 160 * confondre 161 * avec par exemple l'activité d'un navire sur un mois. 162 * @param statusIn Status 163 */ 164 public void setStatus(Status statusIn) 165 { 166 this.status = statusIn; 167 } 168 169 /** 170 * Returns <code>true</code> if the argument is an NumericalPrecision instance and all identifiers for this entity 171 * equal the identifiers of the argument entity. Returns <code>false</code> otherwise. 172 */ 173 @Override 174 public boolean equals(Object object) 175 { 176 if (this == object) 177 { 178 return true; 179 } 180 if (!(object instanceof NumericalPrecision)) 181 { 182 return false; 183 } 184 final NumericalPrecision that = (NumericalPrecision)object; 185 if (this.id == null || that.getId() == null || !this.id.equals(that.getId())) 186 { 187 return false; 188 } 189 return true; 190 } 191 192 /** 193 * Returns a hash code based on this entity's identifiers. 194 */ 195 @Override 196 public int hashCode() 197 { 198 int hashCode = 0; 199 hashCode = 29 * hashCode + (this.id == null ? 0 : this.id.hashCode()); 200 201 return hashCode; 202 } 203 204 /** 205 * Constructs new instances of {@link NumericalPrecision}. 206 */ 207 public static final class Factory 208 { 209 /** 210 * Constructs a new instance of {@link NumericalPrecision}. 211 * @return new NumericalPrecisionImpl() 212 */ 213 public static NumericalPrecision newInstance() 214 { 215 return new NumericalPrecisionImpl(); 216 } 217 218 /** 219 * Constructs a new instance of {@link NumericalPrecision}, taking all required and/or 220 * read-only properties as arguments, except for identifiers. 221 * @param name String 222 * @param description String 223 * @param status Status 224 * @return newInstance 225 */ 226 public static NumericalPrecision newInstance(String name, String description, Status status) 227 { 228 final NumericalPrecision entity = new NumericalPrecisionImpl(); 229 entity.setName(name); 230 entity.setDescription(description); 231 entity.setStatus(status); 232 return entity; 233 } 234 235 /** 236 * Constructs a new instance of {@link NumericalPrecision}, taking all possible properties 237 * (except the identifier(s))as arguments. 238 * @param name String 239 * @param description String 240 * @param updateDate Timestamp 241 * @param status Status 242 * @return newInstance NumericalPrecision 243 */ 244 public static NumericalPrecision newInstance(String name, String description, Timestamp updateDate, Status status) 245 { 246 final NumericalPrecision entity = new NumericalPrecisionImpl(); 247 entity.setName(name); 248 entity.setDescription(description); 249 entity.setUpdateDate(updateDate); 250 entity.setStatus(status); 251 return entity; 252 } 253 } 254 255 /** 256 * @see Comparable#compareTo 257 */ 258 public int compareTo(NumericalPrecision o) 259 { 260 int cmp = 0; 261 if (this.getId() != null) 262 { 263 cmp = this.getId().compareTo(o.getId()); 264 } 265 else 266 { 267 if (this.getName() != null) 268 { 269 cmp = (cmp != 0 ? cmp : this.getName().compareTo(o.getName())); 270 } 271 if (this.getDescription() != null) 272 { 273 cmp = (cmp != 0 ? cmp : this.getDescription().compareTo(o.getDescription())); 274 } 275 if (this.getUpdateDate() != null) 276 { 277 cmp = (cmp != 0 ? cmp : this.getUpdateDate().compareTo(o.getUpdateDate())); 278 } 279 } 280 return cmp; 281 } 282// HibernateEntity.vsl merge-point 283// NumericalPrecision.java merge-point 284}