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.technical.versionning; 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; 033import java.util.Date; 034 035/** 036 * Historiqque des versions du système. 037 * Chaque mise à jour du schéma entraine une insertion dans cette table. 038 */ 039// HibernateEntity.vsl annotations merge-point 040public abstract class SystemVersion 041 implements Serializable, Comparable<SystemVersion> 042{ 043 /** 044 * The serial version UID of this class. Needed for serialization. 045 */ 046 private static final long serialVersionUID = 2425240381735860419L; 047 048 // Generate 6 attributes 049 private Integer id; 050 051 /** 052 * 053 * @return this.id Integer 054 */ 055 public Integer getId() 056 { 057 return this.id; 058 } 059 060 /** 061 * 062 * @param idIn Integer 063 */ 064 public void setId(Integer idIn) 065 { 066 this.id = idIn; 067 } 068 069 private String label; 070 071 /** 072 * <html> 073 * <head> 074 * <style> 075 * p {padding:0px; margin:0px;} 076 * </style> 077 * </head> 078 * <body> 079 * <p> 080 * The version string. Version identifiers should have three or four 081 * components: 082 * </p> 083 * <p> 084 * </p> 085 * <ol> 086 * <li> 087 * Major version. A non-negative integer. 088 * </li> 089 * <li> 090 * Minor version. A non-negative integer. 091 * </li> 092 * <li> 093 * Micro version. A non-negative integer. 094 * </li> 095 * <li> 096 * Qualifier (optional). A text string compatible with regex : 097 * ([0-9]|[a-zA-Z]|_|-)+ 098 * </li> 099 * </ol> 100 * <p> 101 * </p> 102 * <p> 103 * See osgi Version specification : <a 104 * href="http://www.osgi.org/javadoc/r4v42/org/osgi/framework/Version.html">http://www.osgi.org/javadoc/r4v42/org/osgi/framework/Version.html</a> 105 * </p> 106 * <p> 107 * </p> 108 * <p> 109 * Example : 110 * </p> 111 * <ul> 112 * <li> 113 * 3.4.1 114 * </li> 115 * <li> 116 * 3.4.1.20130820 117 * </li> 118 * <li> 119 * ... 120 * </li> 121 * </ul> 122 * <p> 123 * </p> 124 * </body> 125 * </html> 126 * @return this.label String 127 */ 128 public String getLabel() 129 { 130 return this.label; 131 } 132 133 /** 134 * <html> 135 * <head> 136 * <style> 137 * p {padding:0px; margin:0px;} 138 * </style> 139 * </head> 140 * <body> 141 * <p> 142 * The version string. Version identifiers should have three or four 143 * components: 144 * </p> 145 * <p> 146 * </p> 147 * <ol> 148 * <li> 149 * Major version. A non-negative integer. 150 * </li> 151 * <li> 152 * Minor version. A non-negative integer. 153 * </li> 154 * <li> 155 * Micro version. A non-negative integer. 156 * </li> 157 * <li> 158 * Qualifier (optional). A text string compatible with regex : 159 * ([0-9]|[a-zA-Z]|_|-)+ 160 * </li> 161 * </ol> 162 * <p> 163 * </p> 164 * <p> 165 * See osgi Version specification : <a 166 * href="http://www.osgi.org/javadoc/r4v42/org/osgi/framework/Version.html">http://www.osgi.org/javadoc/r4v42/org/osgi/framework/Version.html</a> 167 * </p> 168 * <p> 169 * </p> 170 * <p> 171 * Example : 172 * </p> 173 * <ul> 174 * <li> 175 * 3.4.1 176 * </li> 177 * <li> 178 * 3.4.1.20130820 179 * </li> 180 * <li> 181 * ... 182 * </li> 183 * </ul> 184 * <p> 185 * </p> 186 * </body> 187 * </html> 188 * @param labelIn String 189 */ 190 public void setLabel(String labelIn) 191 { 192 this.label = labelIn; 193 } 194 195 private String description; 196 197 /** 198 * 199 * @return this.description String 200 */ 201 public String getDescription() 202 { 203 return this.description; 204 } 205 206 /** 207 * 208 * @param descriptionIn String 209 */ 210 public void setDescription(String descriptionIn) 211 { 212 this.description = descriptionIn; 213 } 214 215 private Date creationDate; 216 217 /** 218 * 219 * @return this.creationDate Date 220 */ 221 public Date getCreationDate() 222 { 223 return this.creationDate; 224 } 225 226 /** 227 * 228 * @param creationDateIn Date 229 */ 230 public void setCreationDate(Date creationDateIn) 231 { 232 this.creationDate = creationDateIn; 233 } 234 235 private String comments; 236 237 /** 238 * 239 * @return this.comments String 240 */ 241 public String getComments() 242 { 243 return this.comments; 244 } 245 246 /** 247 * 248 * @param commentsIn String 249 */ 250 public void setComments(String commentsIn) 251 { 252 this.comments = commentsIn; 253 } 254 255 private Timestamp updateDate; 256 257 /** 258 * 259 * @return this.updateDate Timestamp 260 */ 261 public Timestamp getUpdateDate() 262 { 263 return this.updateDate; 264 } 265 266 /** 267 * 268 * @param updateDateIn Timestamp 269 */ 270 public void setUpdateDate(Timestamp updateDateIn) 271 { 272 this.updateDate = updateDateIn; 273 } 274 275 // Generate 0 associations 276 /** 277 * Returns <code>true</code> if the argument is an SystemVersion instance and all identifiers for this entity 278 * equal the identifiers of the argument entity. Returns <code>false</code> otherwise. 279 */ 280 @Override 281 public boolean equals(Object object) 282 { 283 if (this == object) 284 { 285 return true; 286 } 287 if (!(object instanceof SystemVersion)) 288 { 289 return false; 290 } 291 final SystemVersion that = (SystemVersion)object; 292 if (this.id == null || that.getId() == null || !this.id.equals(that.getId())) 293 { 294 return false; 295 } 296 return true; 297 } 298 299 /** 300 * Returns a hash code based on this entity's identifiers. 301 */ 302 @Override 303 public int hashCode() 304 { 305 int hashCode = 0; 306 hashCode = 29 * hashCode + (this.id == null ? 0 : this.id.hashCode()); 307 308 return hashCode; 309 } 310 311 /** 312 * Constructs new instances of {@link SystemVersion}. 313 */ 314 public static final class Factory 315 { 316 /** 317 * Constructs a new instance of {@link SystemVersion}. 318 * @return new SystemVersionImpl() 319 */ 320 public static SystemVersion newInstance() 321 { 322 return new SystemVersionImpl(); 323 } 324 325 /** 326 * Constructs a new instance of {@link SystemVersion}, taking all required and/or 327 * read-only properties as arguments, except for identifiers. 328 * @param label String 329 * @param creationDate Date 330 * @param updateDate Timestamp 331 * @return newInstance 332 */ 333 public static SystemVersion newInstance(String label, Date creationDate, Timestamp updateDate) 334 { 335 final SystemVersion entity = new SystemVersionImpl(); 336 entity.setLabel(label); 337 entity.setCreationDate(creationDate); 338 entity.setUpdateDate(updateDate); 339 return entity; 340 } 341 342 /** 343 * Constructs a new instance of {@link SystemVersion}, taking all possible properties 344 * (except the identifier(s))as arguments. 345 * @param label String 346 * @param description String 347 * @param creationDate Date 348 * @param comments String 349 * @param updateDate Timestamp 350 * @return newInstance SystemVersion 351 */ 352 public static SystemVersion newInstance(String label, String description, Date creationDate, String comments, Timestamp updateDate) 353 { 354 final SystemVersion entity = new SystemVersionImpl(); 355 entity.setLabel(label); 356 entity.setDescription(description); 357 entity.setCreationDate(creationDate); 358 entity.setComments(comments); 359 entity.setUpdateDate(updateDate); 360 return entity; 361 } 362 } 363 364 /** 365 * @see Comparable#compareTo 366 */ 367 public int compareTo(SystemVersion o) 368 { 369 int cmp = 0; 370 if (this.getId() != null) 371 { 372 cmp = this.getId().compareTo(o.getId()); 373 } 374 else 375 { 376 if (this.getLabel() != null) 377 { 378 cmp = (cmp != 0 ? cmp : this.getLabel().compareTo(o.getLabel())); 379 } 380 if (this.getDescription() != null) 381 { 382 cmp = (cmp != 0 ? cmp : this.getDescription().compareTo(o.getDescription())); 383 } 384 if (this.getCreationDate() != null) 385 { 386 cmp = (cmp != 0 ? cmp : this.getCreationDate().compareTo(o.getCreationDate())); 387 } 388 if (this.getComments() != null) 389 { 390 cmp = (cmp != 0 ? cmp : this.getComments().compareTo(o.getComments())); 391 } 392 if (this.getUpdateDate() != null) 393 { 394 cmp = (cmp != 0 ? cmp : this.getUpdateDate().compareTo(o.getUpdateDate())); 395 } 396 } 397 return cmp; 398 } 399// HibernateEntity.vsl merge-point 400// SystemVersion.java merge-point 401}