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.gear; 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 * <html> 036 * <head> 037 * <style> 038 * p {padding:0px; margin:0px;} 039 * </style> 040 * </head> 041 * <body> 042 * <p> 043 * @deprecated NE PLUS UTILISER - Utiliser plutot <i>Grouping</i> 044 * </p> 045 * <p> 046 *   047 * </p> 048 * <p> 049 * Défini les coresspondances d'un engin avec des engins d'autres classifications. 050 * </p> 051 * <p> 052 * [Regle de gestion] <b>Les correspondances au sein d'une meme classification sont interdites. 053 * </b><br>[Regle de gestion] <b>La correspondance vers une classification doit avoir été autorisée 054 * au préalable, au niveau de "GearClassificationSynonym" 055 * </b><br> 056 * </p> 057 * <p> 058 * Si la coresspondance est exacte (les engins des deux classifications sont synonymes), alors 059 * chaque engin doit avoir une correspondance vers l'autre. 060 * </p> 061 * <p> 062 * Si la coresspondance n'est pas exacte (un engin A correspond à un engin B, mais l'inverse n'est 063 * pas vrai), alors une seule correspondance de A vers B est définie. 064 * <br> 065 * </p> 066 * <p> 067 * <br> 068 * </p> 069 * </body> 070 * </html> 071 */ 072// HibernateEntity.vsl annotations merge-point 073public abstract class GearAssociation 074 implements Serializable, Comparable<GearAssociation> 075{ 076 /** 077 * The serial version UID of this class. Needed for serialization. 078 */ 079 private static final long serialVersionUID = -4168221693816581038L; 080 081 private GearAssociationPK gearAssociationPk; 082 083 /** 084 * Get the composite primary key identifier class 085 * @return gearAssociationPk 086 */ 087 public GearAssociationPK getGearAssociationPk() 088 { 089 return this.gearAssociationPk; 090 } 091 092 /** 093 * Set the composite primary key identifier class 094 * @param gearAssociationPkIn 095 */ 096 public void setGearAssociationPk(GearAssociationPK gearAssociationPkIn) { 097 this.gearAssociationPk = gearAssociationPkIn; 098 } 099 100 // Generate 1 attributes 101 private Timestamp updateDate; 102 103 /** 104 * 105 * @return this.updateDate Timestamp 106 */ 107 public Timestamp getUpdateDate() 108 { 109 return this.updateDate; 110 } 111 112 /** 113 * 114 * @param updateDateIn Timestamp 115 */ 116 public void setUpdateDate(Timestamp updateDateIn) 117 { 118 this.updateDate = updateDateIn; 119 } 120 121 // Generate 2 associations 122 private Gear toGear; 123 124 /** 125 * <html> 126 * <head> 127 * </head> 128 * <body> 129 * <p> 130 * Défini un engin, non pas engin physique, mais au sens "classe d'engin". 131 * </p> 132 * <p> 133 * Il est possible de définir un arboresence d'engin, au sein d'une meme 134 * classification, via les liens d'engin parents/enfants. 135 * </p> 136 * <p> 137 * <br> 138 * </p> 139 * <p> 140 * Exemple, pour la classification 'Engin EU corpus' : 141 * </p> 142 * <p> 143 * * 'corpus effort de pêche'<br>- PAL Palangre de surface (Longliner)<br> 144 * </p> 145 * <p> 146 * - EP1 Engins petits pélagiques - corpus réglementaire 685/95 147 * </p> 148 * <p> 149 * * corpus 2 (...)<br>- ... 150 * </p> 151 * <p> 152 * <br> 153 * </p> 154 * <p> 155 * Exemple, pour la classification 'FAO/CISTEP' :<br>* 'chaluts' (code 156 * '03.0.0')<br> 157 * </p> 158 * <p> 159 * - 'OTB' 'chalut de fond'<br> 160 * </p> 161 * <p> 162 * - chalut pélagique 163 * </p> 164 * <p> 165 * - ...<br>* 'Filets' 166 * </p> 167 * </body> 168 * </html> 169 * @return this.toGear Gear 170 */ 171 public Gear getToGear() 172 { 173 return this.toGear; 174 } 175 176 /** 177 * <html> 178 * <head> 179 * </head> 180 * <body> 181 * <p> 182 * Défini un engin, non pas engin physique, mais au sens "classe d'engin". 183 * </p> 184 * <p> 185 * Il est possible de définir un arboresence d'engin, au sein d'une meme 186 * classification, via les liens d'engin parents/enfants. 187 * </p> 188 * <p> 189 * <br> 190 * </p> 191 * <p> 192 * Exemple, pour la classification 'Engin EU corpus' : 193 * </p> 194 * <p> 195 * * 'corpus effort de pêche'<br>- PAL Palangre de surface (Longliner)<br> 196 * </p> 197 * <p> 198 * - EP1 Engins petits pélagiques - corpus réglementaire 685/95 199 * </p> 200 * <p> 201 * * corpus 2 (...)<br>- ... 202 * </p> 203 * <p> 204 * <br> 205 * </p> 206 * <p> 207 * Exemple, pour la classification 'FAO/CISTEP' :<br>* 'chaluts' (code 208 * '03.0.0')<br> 209 * </p> 210 * <p> 211 * - 'OTB' 'chalut de fond'<br> 212 * </p> 213 * <p> 214 * - chalut pélagique 215 * </p> 216 * <p> 217 * - ...<br>* 'Filets' 218 * </p> 219 * </body> 220 * </html> 221 * @param toGearIn Gear 222 */ 223 public void setToGear(Gear toGearIn) 224 { 225 this.toGear = toGearIn; 226 } 227 228 private Gear fromGear; 229 230 /** 231 * un type d'engin peut avoir des synonymes. 232 * Un type d'egnin A ayant pour synonyme B, ne signifie pas forcément que B est un synonyme de 233 * A. 234 * @return this.fromGear Gear 235 */ 236 public Gear getFromGear() 237 { 238 return this.fromGear; 239 } 240 241 /** 242 * un type d'engin peut avoir des synonymes. 243 * Un type d'egnin A ayant pour synonyme B, ne signifie pas forcément que B est un synonyme de 244 * A. 245 * @param fromGearIn Gear 246 */ 247 public void setFromGear(Gear fromGearIn) 248 { 249 this.fromGear = fromGearIn; 250 } 251 252 /** 253 * This entity does not have any identifiers 254 * and is not extending any other entity, 255 * so this method will only return <code>true</code> if the argument reference and <code>this</code> 256 * refer to the same object. 257 */ 258 @Override 259 public boolean equals(Object object) 260 { 261 return super.equals(object); 262 } 263 264 /** 265 * This entity does not have any identifiers 266 * and is not extending any other entity, 267 * so this method will only take the identifiers of this entity into account when calculating the hash code. 268 */ 269 @Override 270 public int hashCode() 271 { 272 return super.hashCode(); 273 } 274 275 /** 276 * Constructs new instances of {@link GearAssociation}. 277 */ 278 public static final class Factory 279 { 280 /** 281 * Constructs a new instance of {@link GearAssociation}. 282 * @return new GearAssociationImpl() 283 */ 284 public static GearAssociation newInstance() 285 { 286 return new GearAssociationImpl(); 287 } 288 289 290 /** 291 * Constructs a new instance of {@link GearAssociation}, taking all possible properties 292 * (except the identifier(s))as arguments. 293 * @param updateDate Timestamp 294 * @param toGear Gear 295 * @param fromGear Gear 296 * @return newInstance GearAssociation 297 */ 298 public static GearAssociation newInstance(Timestamp updateDate, Gear toGear, Gear fromGear) 299 { 300 final GearAssociation entity = new GearAssociationImpl(); 301 entity.setUpdateDate(updateDate); 302 entity.setToGear(toGear); 303 entity.setFromGear(fromGear); 304 return entity; 305 } 306 } 307 308 /** 309 * @see Comparable#compareTo 310 */ 311 public int compareTo(GearAssociation o) 312 { 313 int cmp = 0; 314 if (this.getGearAssociationPk() != null) 315 { 316 cmp = this.getGearAssociationPk().compareTo(o.getGearAssociationPk()); 317 } 318 if (this.getUpdateDate() != null) 319 { 320 cmp = (cmp != 0 ? cmp : this.getUpdateDate().compareTo(o.getUpdateDate())); 321 } 322 return cmp; 323 } 324// HibernateEntity.vsl merge-point 325// GearAssociation.java merge-point 326}