1 // license-header java merge-point 2 // 3 // Attention: Generated code! Do not modify by hand! 4 // Generated by: hibernate/HibernateEntity.vsl in andromda-hibernate-cartridge. 5 // 6 package fr.ifremer.quadrige3.core.dao.data.aquaculture; 7 8 /*- 9 * #%L 10 * Quadrige3 Core :: Client API 11 * %% 12 * Copyright (C) 2017 - 2024 Ifremer 13 * %% 14 * This program is free software: you can redistribute it and/or modify 15 * it under the terms of the GNU Affero General Public License as published by 16 * the Free Software Foundation, either version 3 of the License, or 17 * (at your option) any later version. 18 * 19 * This program is distributed in the hope that it will be useful, 20 * but WITHOUT ANY WARRANTY; without even the implied warranty of 21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 * GNU General Public License for more details. 23 * 24 * You should have received a copy of the GNU Affero General Public License 25 * along with this program. If not, see <http://www.gnu.org/licenses/>. 26 * #L% 27 */ 28 import fr.ifremer.quadrige3.core.dao.referential.Status; 29 import java.io.Serializable; 30 import java.sql.Timestamp; 31 import java.util.Collection; 32 import java.util.HashSet; 33 34 /** 35 * La ploïdie d'une cellule caractérise le nombre et l'organisation de ses chromosomes 36 */ 37 // HibernateEntity.vsl annotations merge-point 38 public abstract class Ploidy 39 implements Serializable, Comparable<Ploidy> 40 { 41 /** 42 * The serial version UID of this class. Needed for serialization. 43 */ 44 private static final long serialVersionUID = -8399926269106863556L; 45 46 // Generate 4 attributes 47 private Integer ploidyId; 48 49 /** 50 * Identifiant de la ploïdie 51 * @return this.ploidyId Integer 52 */ 53 public Integer getPloidyId() 54 { 55 return this.ploidyId; 56 } 57 58 /** 59 * Identifiant de la ploïdie 60 * @param ploidyIdIn Integer 61 */ 62 public void setPloidyId(Integer ploidyIdIn) 63 { 64 this.ploidyId = ploidyIdIn; 65 } 66 67 private String ploidyNm; 68 69 /** 70 * Libellé de la ploïdie 71 * @return this.ploidyNm String 72 */ 73 public String getPloidyNm() 74 { 75 return this.ploidyNm; 76 } 77 78 /** 79 * Libellé de la ploïdie 80 * @param ploidyNmIn String 81 */ 82 public void setPloidyNm(String ploidyNmIn) 83 { 84 this.ploidyNm = ploidyNmIn; 85 } 86 87 private Timestamp updateDt; 88 89 /** 90 * Date de maj 91 * @return this.updateDt Timestamp 92 */ 93 public Timestamp getUpdateDt() 94 { 95 return this.updateDt; 96 } 97 98 /** 99 * Date de maj 100 * @param updateDtIn Timestamp 101 */ 102 public void setUpdateDt(Timestamp updateDtIn) 103 { 104 this.updateDt = updateDtIn; 105 } 106 107 private Integer remoteId; 108 109 /** 110 * 111 * @return this.remoteId Integer 112 */ 113 public Integer getRemoteId() 114 { 115 return this.remoteId; 116 } 117 118 /** 119 * 120 * @param remoteIdIn Integer 121 */ 122 public void setRemoteId(Integer remoteIdIn) 123 { 124 this.remoteId = remoteIdIn; 125 } 126 127 // Generate 2 associations 128 private Collection<InitialPopulation> initialPopulations = new HashSet<InitialPopulation>(); 129 130 /** 131 * Pour les données aquacoles de nombreuses études consiste à voir les évolutions de plusieurs 132 * paramètres sur une même population de mollusques répartis en lots sur le littoral français. 133 * Cela 134 * permet de comparer les évolutions liées seulement au site. On part d'un ensemble de 135 * mollusques, que 136 * l'on appelle population initiale, au niveau national et l'on repartit cet ensemble en lots 137 * sur 138 * différents lieux de mesures. 139 * @return this.initialPopulations Collection<InitialPopulation> 140 */ 141 public Collection<InitialPopulation> getInitialPopulations() 142 { 143 return this.initialPopulations; 144 } 145 146 /** 147 * Pour les données aquacoles de nombreuses études consiste à voir les évolutions de plusieurs 148 * paramètres sur une même population de mollusques répartis en lots sur le littoral français. 149 * Cela 150 * permet de comparer les évolutions liées seulement au site. On part d'un ensemble de 151 * mollusques, que 152 * l'on appelle population initiale, au niveau national et l'on repartit cet ensemble en lots 153 * sur 154 * différents lieux de mesures. 155 * @param initialPopulationsIn Collection<InitialPopulation> 156 */ 157 public void setInitialPopulations(Collection<InitialPopulation> initialPopulationsIn) 158 { 159 this.initialPopulations = initialPopulationsIn; 160 } 161 162 /** 163 * Pour les données aquacoles de nombreuses études consiste à voir les évolutions de plusieurs 164 * paramètres sur une même population de mollusques répartis en lots sur le littoral français. 165 * Cela 166 * permet de comparer les évolutions liées seulement au site. On part d'un ensemble de 167 * mollusques, que 168 * l'on appelle population initiale, au niveau national et l'on repartit cet ensemble en lots 169 * sur 170 * différents lieux de mesures. 171 * @param elementToAdd InitialPopulation 172 * @return <tt>true</tt> if this collection changed as a result of the 173 * call 174 */ 175 public boolean addInitialPopulations(InitialPopulation elementToAdd) 176 { 177 return this.initialPopulations.add(elementToAdd); 178 } 179 180 /** 181 * Pour les données aquacoles de nombreuses études consiste à voir les évolutions de plusieurs 182 * paramètres sur une même population de mollusques répartis en lots sur le littoral français. 183 * Cela 184 * permet de comparer les évolutions liées seulement au site. On part d'un ensemble de 185 * mollusques, que 186 * l'on appelle population initiale, au niveau national et l'on repartit cet ensemble en lots 187 * sur 188 * différents lieux de mesures. 189 * @param elementToRemove InitialPopulation 190 * @return <tt>true</tt> if this collection changed as a result of the 191 * call 192 */ 193 public boolean removeInitialPopulations(InitialPopulation elementToRemove) 194 { 195 return this.initialPopulations.remove(elementToRemove); 196 } 197 198 private Status status; 199 200 /** 201 * Liste des états possibles d'un objet. 202 * @return this.status Status 203 */ 204 public Status getStatus() 205 { 206 return this.status; 207 } 208 209 /** 210 * Liste des états possibles d'un objet. 211 * @param statusIn Status 212 */ 213 public void setStatus(Status statusIn) 214 { 215 this.status = statusIn; 216 } 217 218 /** 219 * Returns <code>true</code> if the argument is an Ploidy instance and all identifiers for this entity 220 * equal the identifiers of the argument entity. Returns <code>false</code> otherwise. 221 */ 222 @Override 223 public boolean equals(Object object) 224 { 225 if (this == object) 226 { 227 return true; 228 } 229 if (!(object instanceof Ploidy)) 230 { 231 return false; 232 } 233 final Ploidy that = (Ploidy)object; 234 if (this.ploidyId == null || that.getPloidyId() == null || !this.ploidyId.equals(that.getPloidyId())) 235 { 236 return false; 237 } 238 return true; 239 } 240 241 /** 242 * Returns a hash code based on this entity's identifiers. 243 */ 244 @Override 245 public int hashCode() 246 { 247 int hashCode = 0; 248 hashCode = 29 * hashCode + (this.ploidyId == null ? 0 : this.ploidyId.hashCode()); 249 250 return hashCode; 251 } 252 253 /** 254 * Constructs new instances of {@link Ploidy}. 255 */ 256 public static final class Factory 257 { 258 /** 259 * Constructs a new instance of {@link Ploidy}. 260 * @return new PloidyImpl() 261 */ 262 public static Ploidy newInstance() 263 { 264 return new PloidyImpl(); 265 } 266 267 /** 268 * Constructs a new instance of {@link Ploidy}, taking all required and/or 269 * read-only properties as arguments, except for identifiers. 270 * @param ploidyNm String 271 * @param status Status 272 * @return newInstance 273 */ 274 public static Ploidy newInstance(String ploidyNm, Status status) 275 { 276 final Ploidy entity = new PloidyImpl(); 277 entity.setPloidyNm(ploidyNm); 278 entity.setStatus(status); 279 return entity; 280 } 281 282 /** 283 * Constructs a new instance of {@link Ploidy}, taking all possible properties 284 * (except the identifier(s))as arguments. 285 * @param ploidyNm String 286 * @param updateDt Timestamp 287 * @param remoteId Integer 288 * @param initialPopulations Collection<InitialPopulation> 289 * @param status Status 290 * @return newInstance Ploidy 291 */ 292 public static Ploidy newInstance(String ploidyNm, Timestamp updateDt, Integer remoteId, Collection<InitialPopulation> initialPopulations, Status status) 293 { 294 final Ploidy entity = new PloidyImpl(); 295 entity.setPloidyNm(ploidyNm); 296 entity.setUpdateDt(updateDt); 297 entity.setRemoteId(remoteId); 298 entity.setInitialPopulations(initialPopulations); 299 entity.setStatus(status); 300 return entity; 301 } 302 } 303 304 /** 305 * @see Comparable#compareTo 306 */ 307 public int compareTo(Ploidy o) 308 { 309 int cmp = 0; 310 if (this.getPloidyId() != null) 311 { 312 cmp = this.getPloidyId().compareTo(o.getPloidyId()); 313 } 314 else 315 { 316 if (this.getPloidyNm() != null) 317 { 318 cmp = (cmp != 0 ? cmp : this.getPloidyNm().compareTo(o.getPloidyNm())); 319 } 320 if (this.getUpdateDt() != null) 321 { 322 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt())); 323 } 324 if (this.getRemoteId() != null) 325 { 326 cmp = (cmp != 0 ? cmp : this.getRemoteId().compareTo(o.getRemoteId())); 327 } 328 } 329 return cmp; 330 } 331 // HibernateEntity.vsl merge-point 332 // Ploidy.java merge-point 333 }