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