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 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 * Type de gradient de profondeur de la zone de pêche. 036 */ 037// HibernateEntity.vsl annotations merge-point 038public abstract class DepthGradient 039 implements Serializable, Comparable<DepthGradient> 040{ 041 /** 042 * The serial version UID of this class. Needed for serialization. 043 */ 044 private static final long serialVersionUID = -7029361894189856668L; 045 046 // Generate 7 attributes 047 private String comments; 048 049 /** 050 * 051 * @return this.comments String 052 */ 053 public String getComments() 054 { 055 return this.comments; 056 } 057 058 /** 059 * 060 * @param commentsIn String 061 */ 062 public void setComments(String commentsIn) 063 { 064 this.comments = commentsIn; 065 } 066 067 private Integer id; 068 069 /** 070 * Idenfiant interne. Généré par le système. 071 * @return this.id Integer 072 */ 073 public Integer getId() 074 { 075 return this.id; 076 } 077 078 /** 079 * Idenfiant interne. Généré par le système. 080 * @param idIn Integer 081 */ 082 public void setId(Integer idIn) 083 { 084 this.id = idIn; 085 } 086 087 private String label; 088 089 /** 090 * 091 * @return this.label String 092 */ 093 public String getLabel() 094 { 095 return this.label; 096 } 097 098 /** 099 * 100 * @param labelIn String 101 */ 102 public void setLabel(String labelIn) 103 { 104 this.label = labelIn; 105 } 106 107 private String name; 108 109 /** 110 * 111 * @return this.name String 112 */ 113 public String getName() 114 { 115 return this.name; 116 } 117 118 /** 119 * 120 * @param nameIn String 121 */ 122 public void setName(String nameIn) 123 { 124 this.name = nameIn; 125 } 126 127 private String description; 128 129 /** 130 * 131 * @return this.description String 132 */ 133 public String getDescription() 134 { 135 return this.description; 136 } 137 138 /** 139 * 140 * @param descriptionIn String 141 */ 142 public void setDescription(String descriptionIn) 143 { 144 this.description = descriptionIn; 145 } 146 147 private Short rankOrder; 148 149 /** 150 * Ordre de présentation du gradient, par rapports au autres gradient. 151 * permet d'ordonner les gradient dans les listes déroulantes dans les interface de saisie 152 * Allegro. 153 * @return this.rankOrder Short 154 */ 155 public Short getRankOrder() 156 { 157 return this.rankOrder; 158 } 159 160 /** 161 * Ordre de présentation du gradient, par rapports au autres gradient. 162 * permet d'ordonner les gradient dans les listes déroulantes dans les interface de saisie 163 * Allegro. 164 * @param rankOrderIn Short 165 */ 166 public void setRankOrder(Short rankOrderIn) 167 { 168 this.rankOrder = rankOrderIn; 169 } 170 171 private Timestamp updateDate; 172 173 /** 174 * 175 * @return this.updateDate Timestamp 176 */ 177 public Timestamp getUpdateDate() 178 { 179 return this.updateDate; 180 } 181 182 /** 183 * 184 * @param updateDateIn Timestamp 185 */ 186 public void setUpdateDate(Timestamp updateDateIn) 187 { 188 this.updateDate = updateDateIn; 189 } 190 191 // Generate 3 associations 192 private Status status; 193 194 /** 195 * Pour les données du référentiel, information permettant de déterminer si une donnée est 196 * valide, 197 * obsolète ou temporaire. 198 * - obsolète (=inactif) : '0' 199 * - valide (=actif) : '1' 200 * - temporaire : '2' 201 * - en cours de suppression : '3' 202 * - : '4' 203 * note : on a préfère ici 'valide' au terme 'actif' (utilisé dans Harmonie), pour ne pas 204 * confondre 205 * avec par exemple l'activité d'un navire sur un mois. 206 * @return this.status Status 207 */ 208 public Status getStatus() 209 { 210 return this.status; 211 } 212 213 /** 214 * Pour les données du référentiel, information permettant de déterminer si une donnée est 215 * valide, 216 * obsolète ou temporaire. 217 * - obsolète (=inactif) : '0' 218 * - valide (=actif) : '1' 219 * - temporaire : '2' 220 * - en cours de suppression : '3' 221 * - : '4' 222 * note : on a préfère ici 'valide' au terme 'actif' (utilisé dans Harmonie), pour ne pas 223 * confondre 224 * avec par exemple l'activité d'un navire sur un mois. 225 * @param statusIn Status 226 */ 227 public void setStatus(Status statusIn) 228 { 229 this.status = statusIn; 230 } 231 232 /** 233 * Returns <code>true</code> if the argument is an DepthGradient instance and all identifiers for this entity 234 * equal the identifiers of the argument entity. Returns <code>false</code> otherwise. 235 */ 236 @Override 237 public boolean equals(Object object) 238 { 239 if (this == object) 240 { 241 return true; 242 } 243 if (!(object instanceof DepthGradient)) 244 { 245 return false; 246 } 247 final DepthGradient that = (DepthGradient)object; 248 if (this.id == null || that.getId() == null || !this.id.equals(that.getId())) 249 { 250 return false; 251 } 252 return true; 253 } 254 255 /** 256 * Returns a hash code based on this entity's identifiers. 257 */ 258 @Override 259 public int hashCode() 260 { 261 int hashCode = 0; 262 hashCode = 29 * hashCode + (this.id == null ? 0 : this.id.hashCode()); 263 264 return hashCode; 265 } 266 267 /** 268 * Constructs new instances of {@link DepthGradient}. 269 */ 270 public static final class Factory 271 { 272 /** 273 * Constructs a new instance of {@link DepthGradient}. 274 * @return new DepthGradientImpl() 275 */ 276 public static DepthGradient newInstance() 277 { 278 return new DepthGradientImpl(); 279 } 280 281 /** 282 * Constructs a new instance of {@link DepthGradient}, taking all required and/or 283 * read-only properties as arguments, except for identifiers. 284 * @param label String 285 * @param name String 286 * @param description String 287 * @param rankOrder Short 288 * @param updateDate Timestamp 289 * @param status Status 290 * @return newInstance 291 */ 292 public static DepthGradient newInstance(String label, String name, String description, Short rankOrder, Timestamp updateDate, Status status) 293 { 294 final DepthGradient entity = new DepthGradientImpl(); 295 entity.setLabel(label); 296 entity.setName(name); 297 entity.setDescription(description); 298 entity.setRankOrder(rankOrder); 299 entity.setUpdateDate(updateDate); 300 entity.setStatus(status); 301 return entity; 302 } 303 304 /** 305 * Constructs a new instance of {@link DepthGradient}, taking all possible properties 306 * (except the identifier(s))as arguments. 307 * @param comments String 308 * @param label String 309 * @param name String 310 * @param description String 311 * @param rankOrder Short 312 * @param updateDate Timestamp 313 * @param status Status 314 * @return newInstance DepthGradient 315 */ 316 public static DepthGradient newInstance(String comments, String label, String name, String description, Short rankOrder, Timestamp updateDate, Status status) 317 { 318 final DepthGradient entity = new DepthGradientImpl(); 319 entity.setComments(comments); 320 entity.setLabel(label); 321 entity.setName(name); 322 entity.setDescription(description); 323 entity.setRankOrder(rankOrder); 324 entity.setUpdateDate(updateDate); 325 entity.setStatus(status); 326 return entity; 327 } 328 } 329 330 /** 331 * @see Comparable#compareTo 332 */ 333 public int compareTo(DepthGradient o) 334 { 335 int cmp = 0; 336 if (this.getId() != null) 337 { 338 cmp = this.getId().compareTo(o.getId()); 339 } 340 else 341 { 342 if (this.getComments() != null) 343 { 344 cmp = (cmp != 0 ? cmp : this.getComments().compareTo(o.getComments())); 345 } 346 if (this.getLabel() != null) 347 { 348 cmp = (cmp != 0 ? cmp : this.getLabel().compareTo(o.getLabel())); 349 } 350 if (this.getName() != null) 351 { 352 cmp = (cmp != 0 ? cmp : this.getName().compareTo(o.getName())); 353 } 354 if (this.getDescription() != null) 355 { 356 cmp = (cmp != 0 ? cmp : this.getDescription().compareTo(o.getDescription())); 357 } 358 if (this.getRankOrder() != null) 359 { 360 cmp = (cmp != 0 ? cmp : this.getRankOrder().compareTo(o.getRankOrder())); 361 } 362 if (this.getUpdateDate() != null) 363 { 364 cmp = (cmp != 0 ? cmp : this.getUpdateDate().compareTo(o.getUpdateDate())); 365 } 366 } 367 return cmp; 368 } 369// HibernateEntity.vsl merge-point 370// DepthGradient.java merge-point 371}