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