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.playground; 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 com.vividsolutions.jts.geom.Point; 032import fr.ifremer.adagio.core.dao.data.survey.fishingTrip.FishingTrip; 033import fr.ifremer.adagio.core.dao.referential.gear.Gear; 034import java.io.Serializable; 035import java.util.Date; 036 037/** 038 * Mouvements sur zone d'effort : A modeliser ! 039 * ref : flux SACAPT 040 */ 041// HibernateEntity.vsl annotations merge-point 042public abstract class PlaygroundFishingEffortZone 043 implements Serializable, Comparable<PlaygroundFishingEffortZone> 044{ 045 /** 046 * The serial version UID of this class. Needed for serialization. 047 */ 048 private static final long serialVersionUID = -5934829636259117247L; 049 050 // Generate 6 attributes 051 private Integer id; 052 053 /** 054 * 055 * @return this.id Integer 056 */ 057 public Integer getId() 058 { 059 return this.id; 060 } 061 062 /** 063 * 064 * @param idIn Integer 065 */ 066 public void setId(Integer idIn) 067 { 068 this.id = idIn; 069 } 070 071 private Date dateTime; 072 073 /** 074 * 075 * @return this.dateTime Date 076 */ 077 public Date getDateTime() 078 { 079 return this.dateTime; 080 } 081 082 /** 083 * 084 * @param dateTimeIn Date 085 */ 086 public void setDateTime(Date dateTimeIn) 087 { 088 this.dateTime = dateTimeIn; 089 } 090 091 private String moveType; 092 093 /** 094 * 095 * @return this.moveType String 096 */ 097 public String getMoveType() 098 { 099 return this.moveType; 100 } 101 102 /** 103 * 104 * @param moveTypeIn String 105 */ 106 public void setMoveType(String moveTypeIn) 107 { 108 this.moveType = moveTypeIn; 109 } 110 111 private String effortZoneCode; 112 113 /** 114 * 115 * @return this.effortZoneCode String 116 */ 117 public String getEffortZoneCode() 118 { 119 return this.effortZoneCode; 120 } 121 122 /** 123 * 124 * @param effortZoneCodeIn String 125 */ 126 public void setEffortZoneCode(String effortZoneCodeIn) 127 { 128 this.effortZoneCode = effortZoneCodeIn; 129 } 130 131 private String targetSpecies; 132 133 /** 134 * 135 * @return this.targetSpecies String 136 */ 137 public String getTargetSpecies() 138 { 139 return this.targetSpecies; 140 } 141 142 /** 143 * 144 * @param targetSpeciesIn String 145 */ 146 public void setTargetSpecies(String targetSpeciesIn) 147 { 148 this.targetSpecies = targetSpeciesIn; 149 } 150 151 private Point position; 152 153 /** 154 * Geomtry of the fishing effort area (Point geometry) 155 * @return this.position Point 156 */ 157 public Point getPosition() 158 { 159 return this.position; 160 } 161 162 /** 163 * Geomtry of the fishing effort area (Point geometry) 164 * @param positionIn Point 165 */ 166 public void setPosition(Point positionIn) 167 { 168 this.position = positionIn; 169 } 170 171 // Generate 2 associations 172 private Gear gear; 173 174 /** 175 * <html> 176 * <head> 177 * </head> 178 * <body> 179 * <p> 180 * Défini un engin, non pas engin physique, mais au sens "classe d'engin". 181 * </p> 182 * <p> 183 * Il est possible de définir un arboresence d'engin, au sein d'une meme 184 * classification, via les liens d'engin parents/enfants. 185 * </p> 186 * <p> 187 * <br> 188 * </p> 189 * <p> 190 * Exemple, pour la classification 'Engin EU corpus' : 191 * </p> 192 * <p> 193 * * 'corpus effort de pêche'<br>- PAL Palangre de surface (Longliner)<br> 194 * </p> 195 * <p> 196 * - EP1 Engins petits pélagiques - corpus réglementaire 685/95 197 * </p> 198 * <p> 199 * * corpus 2 (...)<br>- ... 200 * </p> 201 * <p> 202 * <br> 203 * </p> 204 * <p> 205 * Exemple, pour la classification 'FAO/CISTEP' :<br>* 'chaluts' (code 206 * '03.0.0')<br> 207 * </p> 208 * <p> 209 * - 'OTB' 'chalut de fond'<br> 210 * </p> 211 * <p> 212 * - chalut pélagique 213 * </p> 214 * <p> 215 * - ...<br>* 'Filets' 216 * </p> 217 * </body> 218 * </html> 219 * @return this.gear Gear 220 */ 221 public Gear getGear() 222 { 223 return this.gear; 224 } 225 226 /** 227 * <html> 228 * <head> 229 * </head> 230 * <body> 231 * <p> 232 * Défini un engin, non pas engin physique, mais au sens "classe d'engin". 233 * </p> 234 * <p> 235 * Il est possible de définir un arboresence d'engin, au sein d'une meme 236 * classification, via les liens d'engin parents/enfants. 237 * </p> 238 * <p> 239 * <br> 240 * </p> 241 * <p> 242 * Exemple, pour la classification 'Engin EU corpus' : 243 * </p> 244 * <p> 245 * * 'corpus effort de pêche'<br>- PAL Palangre de surface (Longliner)<br> 246 * </p> 247 * <p> 248 * - EP1 Engins petits pélagiques - corpus réglementaire 685/95 249 * </p> 250 * <p> 251 * * corpus 2 (...)<br>- ... 252 * </p> 253 * <p> 254 * <br> 255 * </p> 256 * <p> 257 * Exemple, pour la classification 'FAO/CISTEP' :<br>* 'chaluts' (code 258 * '03.0.0')<br> 259 * </p> 260 * <p> 261 * - 'OTB' 'chalut de fond'<br> 262 * </p> 263 * <p> 264 * - chalut pélagique 265 * </p> 266 * <p> 267 * - ...<br>* 'Filets' 268 * </p> 269 * </body> 270 * </html> 271 * @param gearIn Gear 272 */ 273 public void setGear(Gear gearIn) 274 { 275 this.gear = gearIn; 276 } 277 278 private FishingTrip fishingTrip; 279 280 /** 281 * Voyage en mer, ayant pour vocation une activité de peche (peut etre une campagnes halieutique 282 * ou une 283 * marée d'un navire professionnel, etc.) 284 * Un voyage peut représenter type de données : 285 * - Une marée observée (en mer, au débarquement), qui désigne une marée de pêche 286 * professionnelle au 287 * cours de laquelle des relevés sont effectués par un observateur. 288 * - Une marée déclarée. Principalement issue du log book électronique (flux SACAPT). Une marée 289 * déclarée peut etre un ensemble de marée ou de sous-ensembles de marée (Exemple de la fiche de 290 * peche) 291 * - une sortie effectuée lors d"une campagne scientifique 292 * @return this.fishingTrip FishingTrip 293 */ 294 public FishingTrip getFishingTrip() 295 { 296 return this.fishingTrip; 297 } 298 299 /** 300 * Voyage en mer, ayant pour vocation une activité de peche (peut etre une campagnes halieutique 301 * ou une 302 * marée d'un navire professionnel, etc.) 303 * Un voyage peut représenter type de données : 304 * - Une marée observée (en mer, au débarquement), qui désigne une marée de pêche 305 * professionnelle au 306 * cours de laquelle des relevés sont effectués par un observateur. 307 * - Une marée déclarée. Principalement issue du log book électronique (flux SACAPT). Une marée 308 * déclarée peut etre un ensemble de marée ou de sous-ensembles de marée (Exemple de la fiche de 309 * peche) 310 * - une sortie effectuée lors d"une campagne scientifique 311 * @param fishingTripIn FishingTrip 312 */ 313 public void setFishingTrip(FishingTrip fishingTripIn) 314 { 315 this.fishingTrip = fishingTripIn; 316 } 317 318 /** 319 * Returns <code>true</code> if the argument is an PlaygroundFishingEffortZone instance and all identifiers for this entity 320 * equal the identifiers of the argument entity. Returns <code>false</code> otherwise. 321 */ 322 @Override 323 public boolean equals(Object object) 324 { 325 if (this == object) 326 { 327 return true; 328 } 329 if (!(object instanceof PlaygroundFishingEffortZone)) 330 { 331 return false; 332 } 333 final PlaygroundFishingEffortZone that = (PlaygroundFishingEffortZone)object; 334 if (this.id == null || that.getId() == null || !this.id.equals(that.getId())) 335 { 336 return false; 337 } 338 return true; 339 } 340 341 /** 342 * Returns a hash code based on this entity's identifiers. 343 */ 344 @Override 345 public int hashCode() 346 { 347 int hashCode = 0; 348 hashCode = 29 * hashCode + (this.id == null ? 0 : this.id.hashCode()); 349 350 return hashCode; 351 } 352 353 /** 354 * Constructs new instances of {@link PlaygroundFishingEffortZone}. 355 */ 356 public static final class Factory 357 { 358 /** 359 * Constructs a new instance of {@link PlaygroundFishingEffortZone}. 360 * @return new PlaygroundFishingEffortZoneImpl() 361 */ 362 public static PlaygroundFishingEffortZone newInstance() 363 { 364 return new PlaygroundFishingEffortZoneImpl(); 365 } 366 367 /** 368 * Constructs a new instance of {@link PlaygroundFishingEffortZone}, taking all required and/or 369 * read-only properties as arguments, except for identifiers. 370 * @param moveType String 371 * @param effortZoneCode String 372 * @param targetSpecies String 373 * @param gear Gear 374 * @param fishingTrip FishingTrip 375 * @return newInstance 376 */ 377 public static PlaygroundFishingEffortZone newInstance(String moveType, String effortZoneCode, String targetSpecies, Gear gear, FishingTrip fishingTrip) 378 { 379 final PlaygroundFishingEffortZone entity = new PlaygroundFishingEffortZoneImpl(); 380 entity.setMoveType(moveType); 381 entity.setEffortZoneCode(effortZoneCode); 382 entity.setTargetSpecies(targetSpecies); 383 entity.setGear(gear); 384 entity.setFishingTrip(fishingTrip); 385 return entity; 386 } 387 388 /** 389 * Constructs a new instance of {@link PlaygroundFishingEffortZone}, taking all possible properties 390 * (except the identifier(s))as arguments. 391 * @param dateTime Date 392 * @param moveType String 393 * @param effortZoneCode String 394 * @param targetSpecies String 395 * @param position Point 396 * @param gear Gear 397 * @param fishingTrip FishingTrip 398 * @return newInstance PlaygroundFishingEffortZone 399 */ 400 public static PlaygroundFishingEffortZone newInstance(Date dateTime, String moveType, String effortZoneCode, String targetSpecies, Point position, Gear gear, FishingTrip fishingTrip) 401 { 402 final PlaygroundFishingEffortZone entity = new PlaygroundFishingEffortZoneImpl(); 403 entity.setDateTime(dateTime); 404 entity.setMoveType(moveType); 405 entity.setEffortZoneCode(effortZoneCode); 406 entity.setTargetSpecies(targetSpecies); 407 entity.setPosition(position); 408 entity.setGear(gear); 409 entity.setFishingTrip(fishingTrip); 410 return entity; 411 } 412 } 413 414 /** 415 * @see Comparable#compareTo 416 */ 417 public int compareTo(PlaygroundFishingEffortZone o) 418 { 419 int cmp = 0; 420 if (this.getId() != null) 421 { 422 cmp = this.getId().compareTo(o.getId()); 423 } 424 else 425 { 426 if (this.getDateTime() != null) 427 { 428 cmp = (cmp != 0 ? cmp : this.getDateTime().compareTo(o.getDateTime())); 429 } 430 if (this.getMoveType() != null) 431 { 432 cmp = (cmp != 0 ? cmp : this.getMoveType().compareTo(o.getMoveType())); 433 } 434 if (this.getEffortZoneCode() != null) 435 { 436 cmp = (cmp != 0 ? cmp : this.getEffortZoneCode().compareTo(o.getEffortZoneCode())); 437 } 438 if (this.getTargetSpecies() != null) 439 { 440 cmp = (cmp != 0 ? cmp : this.getTargetSpecies().compareTo(o.getTargetSpecies())); 441 } 442 if (this.getPosition() != null) 443 { 444 cmp = (cmp != 0 ? cmp : this.getPosition().compareTo(o.getPosition())); 445 } 446 } 447 return cmp; 448 } 449// HibernateEntity.vsl merge-point 450// PlaygroundFishingEffortZone.java merge-point 451}