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.regulation; 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.Collection; 034import java.util.HashSet; 035 036/** 037 * <html> 038 * <head> 039 * </head> 040 * <body> 041 * Un pecherie, peut etre, si elle n'a pas d'engin, similaire à un 042 * stock.<br><br><u>Définition 043 * </u>:<br>A unit determined by an authority or other entity that isengaged 044 * in raising and/or harvesting fish. Typically, the unit is defined in terms 045 * of some or all of the following: people involved, species or type of fish, 046 * area of water or seabed, method of fishing, class of boats and purpose of 047 * the activities.<br><br><font size="-2">Fletcher, W.J., Chesson, J. Fisher, 048 * M., Sainsbury K.J., Hundloe, T. Smith A.D.M., and B. Whitworth (2002): 049 * National ESD reporting framework for Australian fisheries: The "How To" 050 * guide for wild capture fisheries. FRDC Project 2000/145. Canberra, 051 * Australia</font> 052 * </body> 053 * </html> 054 */ 055// HibernateEntity.vsl annotations merge-point 056public abstract class Fishery 057 implements Serializable, Comparable<Fishery> 058{ 059 /** 060 * The serial version UID of this class. Needed for serialization. 061 */ 062 private static final long serialVersionUID = 290742197811119569L; 063 064 // Generate 6 attributes 065 private Integer id; 066 067 /** 068 * Idenfiant interne. Généré par le système. 069 * @return this.id Integer 070 */ 071 public Integer getId() 072 { 073 return this.id; 074 } 075 076 /** 077 * Idenfiant interne. Généré par le système. 078 * @param idIn Integer 079 */ 080 public void setId(Integer idIn) 081 { 082 this.id = idIn; 083 } 084 085 private String label; 086 087 /** 088 * 089 * @return this.label String 090 */ 091 public String getLabel() 092 { 093 return this.label; 094 } 095 096 /** 097 * 098 * @param labelIn String 099 */ 100 public void setLabel(String labelIn) 101 { 102 this.label = labelIn; 103 } 104 105 private String name; 106 107 /** 108 * 109 * @return this.name String 110 */ 111 public String getName() 112 { 113 return this.name; 114 } 115 116 /** 117 * 118 * @param nameIn String 119 */ 120 public void setName(String nameIn) 121 { 122 this.name = nameIn; 123 } 124 125 private String description; 126 127 /** 128 * 129 * @return this.description String 130 */ 131 public String getDescription() 132 { 133 return this.description; 134 } 135 136 /** 137 * 138 * @param descriptionIn String 139 */ 140 public void setDescription(String descriptionIn) 141 { 142 this.description = descriptionIn; 143 } 144 145 private Timestamp updateDate; 146 147 /** 148 * 149 * @return this.updateDate Timestamp 150 */ 151 public Timestamp getUpdateDate() 152 { 153 return this.updateDate; 154 } 155 156 /** 157 * 158 * @param updateDateIn Timestamp 159 */ 160 public void setUpdateDate(Timestamp updateDateIn) 161 { 162 this.updateDate = updateDateIn; 163 } 164 165 private String comments; 166 167 /** 168 * 169 * @return this.comments String 170 */ 171 public String getComments() 172 { 173 return this.comments; 174 } 175 176 /** 177 * 178 * @param commentsIn String 179 */ 180 public void setComments(String commentsIn) 181 { 182 this.comments = commentsIn; 183 } 184 185 // Generate 8 associations 186 private Collection<Fishery2TaxonGroup> fishery2TaxonGroups = new HashSet<Fishery2TaxonGroup>(); 187 188 /** 189 * 190 * @return this.fishery2TaxonGroups Collection<Fishery2TaxonGroup> 191 */ 192 public Collection<Fishery2TaxonGroup> getFishery2TaxonGroups() 193 { 194 return this.fishery2TaxonGroups; 195 } 196 197 /** 198 * 199 * @param fishery2TaxonGroupsIn Collection<Fishery2TaxonGroup> 200 */ 201 public void setFishery2TaxonGroups(Collection<Fishery2TaxonGroup> fishery2TaxonGroupsIn) 202 { 203 this.fishery2TaxonGroups = fishery2TaxonGroupsIn; 204 } 205 206 /** 207 * 208 * @param elementToAdd Fishery2TaxonGroup 209 * @return <tt>true</tt> if this collection changed as a result of the 210 * call 211 */ 212 public boolean addFishery2TaxonGroups(Fishery2TaxonGroup elementToAdd) 213 { 214 return this.fishery2TaxonGroups.add(elementToAdd); 215 } 216 217 /** 218 * 219 * @param elementToRemove Fishery2TaxonGroup 220 * @return <tt>true</tt> if this collection changed as a result of the 221 * call 222 */ 223 public boolean removeFishery2TaxonGroups(Fishery2TaxonGroup elementToRemove) 224 { 225 return this.fishery2TaxonGroups.remove(elementToRemove); 226 } 227 228 private Collection<Fishery2Grouping> fishery2Groupings = new HashSet<Fishery2Grouping>(); 229 230 /** 231 * 232 * @return this.fishery2Groupings Collection<Fishery2Grouping> 233 */ 234 public Collection<Fishery2Grouping> getFishery2Groupings() 235 { 236 return this.fishery2Groupings; 237 } 238 239 /** 240 * 241 * @param fishery2GroupingsIn Collection<Fishery2Grouping> 242 */ 243 public void setFishery2Groupings(Collection<Fishery2Grouping> fishery2GroupingsIn) 244 { 245 this.fishery2Groupings = fishery2GroupingsIn; 246 } 247 248 /** 249 * 250 * @param elementToAdd Fishery2Grouping 251 * @return <tt>true</tt> if this collection changed as a result of the 252 * call 253 */ 254 public boolean addFishery2Groupings(Fishery2Grouping elementToAdd) 255 { 256 return this.fishery2Groupings.add(elementToAdd); 257 } 258 259 /** 260 * 261 * @param elementToRemove Fishery2Grouping 262 * @return <tt>true</tt> if this collection changed as a result of the 263 * call 264 */ 265 public boolean removeFishery2Groupings(Fishery2Grouping elementToRemove) 266 { 267 return this.fishery2Groupings.remove(elementToRemove); 268 } 269 270 private Collection<Corpus> corpuses = new HashSet<Corpus>(); 271 272 /** 273 * Recueil de textes, de documents qui ont trait à une même matière. 274 * Ex : 275 * * Corpus 1 : réglemente/défini la peche sur des espèces données, sur une zone particulière, 276 * mais 277 * sans définir de droit de produire. 278 * * UGS : Unité de Gestion Statistique. Sert à définir les "stocks réglementaires annuels" liés 279 * aux 280 * quotas. 281 * * zone d'effort 282 * @return this.corpuses Collection<Corpus> 283 */ 284 public Collection<Corpus> getCorpuses() 285 { 286 return this.corpuses; 287 } 288 289 /** 290 * Recueil de textes, de documents qui ont trait à une même matière. 291 * Ex : 292 * * Corpus 1 : réglemente/défini la peche sur des espèces données, sur une zone particulière, 293 * mais 294 * sans définir de droit de produire. 295 * * UGS : Unité de Gestion Statistique. Sert à définir les "stocks réglementaires annuels" liés 296 * aux 297 * quotas. 298 * * zone d'effort 299 * @param corpusesIn Collection<Corpus> 300 */ 301 public void setCorpuses(Collection<Corpus> corpusesIn) 302 { 303 this.corpuses = corpusesIn; 304 } 305 306 /** 307 * Recueil de textes, de documents qui ont trait à une même matière. 308 * Ex : 309 * * Corpus 1 : réglemente/défini la peche sur des espèces données, sur une zone particulière, 310 * mais 311 * sans définir de droit de produire. 312 * * UGS : Unité de Gestion Statistique. Sert à définir les "stocks réglementaires annuels" liés 313 * aux 314 * quotas. 315 * * zone d'effort 316 * @param elementToAdd Corpus 317 * @return <tt>true</tt> if this collection changed as a result of the 318 * call 319 */ 320 public boolean addCorpuses(Corpus elementToAdd) 321 { 322 return this.corpuses.add(elementToAdd); 323 } 324 325 /** 326 * Recueil de textes, de documents qui ont trait à une même matière. 327 * Ex : 328 * * Corpus 1 : réglemente/défini la peche sur des espèces données, sur une zone particulière, 329 * mais 330 * sans définir de droit de produire. 331 * * UGS : Unité de Gestion Statistique. Sert à définir les "stocks réglementaires annuels" liés 332 * aux 333 * quotas. 334 * * zone d'effort 335 * @param elementToRemove Corpus 336 * @return <tt>true</tt> if this collection changed as a result of the 337 * call 338 */ 339 public boolean removeCorpuses(Corpus elementToRemove) 340 { 341 return this.corpuses.remove(elementToRemove); 342 } 343 344 private Collection<RegulationArea> regulationAreas = new HashSet<RegulationArea>(); 345 346 /** 347 * Zone de peche à laquelle la pecherie est rattachée 348 * @return this.regulationAreas Collection<RegulationArea> 349 */ 350 public Collection<RegulationArea> getRegulationAreas() 351 { 352 return this.regulationAreas; 353 } 354 355 /** 356 * Zone de peche à laquelle la pecherie est rattachée 357 * @param regulationAreasIn Collection<RegulationArea> 358 */ 359 public void setRegulationAreas(Collection<RegulationArea> regulationAreasIn) 360 { 361 this.regulationAreas = regulationAreasIn; 362 } 363 364 /** 365 * Zone de peche à laquelle la pecherie est rattachée 366 * @param elementToAdd RegulationArea 367 * @return <tt>true</tt> if this collection changed as a result of the 368 * call 369 */ 370 public boolean addRegulationAreas(RegulationArea elementToAdd) 371 { 372 return this.regulationAreas.add(elementToAdd); 373 } 374 375 /** 376 * Zone de peche à laquelle la pecherie est rattachée 377 * @param elementToRemove RegulationArea 378 * @return <tt>true</tt> if this collection changed as a result of the 379 * call 380 */ 381 public boolean removeRegulationAreas(RegulationArea elementToRemove) 382 { 383 return this.regulationAreas.remove(elementToRemove); 384 } 385 386 private Collection<Fishery2Gear> fishery2Gears = new HashSet<Fishery2Gear>(); 387 388 /** 389 * 390 * @return this.fishery2Gears Collection<Fishery2Gear> 391 */ 392 public Collection<Fishery2Gear> getFishery2Gears() 393 { 394 return this.fishery2Gears; 395 } 396 397 /** 398 * 399 * @param fishery2GearsIn Collection<Fishery2Gear> 400 */ 401 public void setFishery2Gears(Collection<Fishery2Gear> fishery2GearsIn) 402 { 403 this.fishery2Gears = fishery2GearsIn; 404 } 405 406 /** 407 * 408 * @param elementToAdd Fishery2Gear 409 * @return <tt>true</tt> if this collection changed as a result of the 410 * call 411 */ 412 public boolean addFishery2Gears(Fishery2Gear elementToAdd) 413 { 414 return this.fishery2Gears.add(elementToAdd); 415 } 416 417 /** 418 * 419 * @param elementToRemove Fishery2Gear 420 * @return <tt>true</tt> if this collection changed as a result of the 421 * call 422 */ 423 public boolean removeFishery2Gears(Fishery2Gear elementToRemove) 424 { 425 return this.fishery2Gears.remove(elementToRemove); 426 } 427 428 private Collection<Fishery2Metier> fishery2Metiers = new HashSet<Fishery2Metier>(); 429 430 /** 431 * 432 * @return this.fishery2Metiers Collection<Fishery2Metier> 433 */ 434 public Collection<Fishery2Metier> getFishery2Metiers() 435 { 436 return this.fishery2Metiers; 437 } 438 439 /** 440 * 441 * @param fishery2MetiersIn Collection<Fishery2Metier> 442 */ 443 public void setFishery2Metiers(Collection<Fishery2Metier> fishery2MetiersIn) 444 { 445 this.fishery2Metiers = fishery2MetiersIn; 446 } 447 448 /** 449 * 450 * @param elementToAdd Fishery2Metier 451 * @return <tt>true</tt> if this collection changed as a result of the 452 * call 453 */ 454 public boolean addFishery2Metiers(Fishery2Metier elementToAdd) 455 { 456 return this.fishery2Metiers.add(elementToAdd); 457 } 458 459 /** 460 * 461 * @param elementToRemove Fishery2Metier 462 * @return <tt>true</tt> if this collection changed as a result of the 463 * call 464 */ 465 public boolean removeFishery2Metiers(Fishery2Metier elementToRemove) 466 { 467 return this.fishery2Metiers.remove(elementToRemove); 468 } 469 470 /** 471 * Returns <code>true</code> if the argument is an Fishery instance and all identifiers for this entity 472 * equal the identifiers of the argument entity. Returns <code>false</code> otherwise. 473 */ 474 @Override 475 public boolean equals(Object object) 476 { 477 if (this == object) 478 { 479 return true; 480 } 481 if (!(object instanceof Fishery)) 482 { 483 return false; 484 } 485 final Fishery that = (Fishery)object; 486 if (this.id == null || that.getId() == null || !this.id.equals(that.getId())) 487 { 488 return false; 489 } 490 return true; 491 } 492 493 /** 494 * Returns a hash code based on this entity's identifiers. 495 */ 496 @Override 497 public int hashCode() 498 { 499 int hashCode = 0; 500 hashCode = 29 * hashCode + (this.id == null ? 0 : this.id.hashCode()); 501 502 return hashCode; 503 } 504 505 /** 506 * Constructs new instances of {@link Fishery}. 507 */ 508 public static final class Factory 509 { 510 /** 511 * Constructs a new instance of {@link Fishery}. 512 * @return new FisheryImpl() 513 */ 514 public static Fishery newInstance() 515 { 516 return new FisheryImpl(); 517 } 518 519 /** 520 * Constructs a new instance of {@link Fishery}, taking all required and/or 521 * read-only properties as arguments, except for identifiers. 522 * @param label String 523 * @param name String 524 * @param updateDate Timestamp 525 * @param regulationAreas Collection<RegulationArea> 526 * @return newInstance 527 */ 528 public static Fishery newInstance(String label, String name, Timestamp updateDate, Collection<RegulationArea> regulationAreas) 529 { 530 final Fishery entity = new FisheryImpl(); 531 entity.setLabel(label); 532 entity.setName(name); 533 entity.setUpdateDate(updateDate); 534 entity.setRegulationAreas(regulationAreas); 535 return entity; 536 } 537 538 /** 539 * Constructs a new instance of {@link Fishery}, taking all possible properties 540 * (except the identifier(s))as arguments. 541 * @param label String 542 * @param name String 543 * @param description String 544 * @param updateDate Timestamp 545 * @param comments String 546 * @param fishery2TaxonGroups Collection<Fishery2TaxonGroup> 547 * @param fishery2Groupings Collection<Fishery2Grouping> 548 * @param corpuses Collection<Corpus> 549 * @param regulationAreas Collection<RegulationArea> 550 * @param fishery2Gears Collection<Fishery2Gear> 551 * @param fishery2Metiers Collection<Fishery2Metier> 552 * @return newInstance Fishery 553 */ 554 public static Fishery newInstance(String label, String name, String description, Timestamp updateDate, String comments, Collection<Fishery2TaxonGroup> fishery2TaxonGroups, Collection<Fishery2Grouping> fishery2Groupings, Collection<Corpus> corpuses, Collection<RegulationArea> regulationAreas, Collection<Fishery2Gear> fishery2Gears, Collection<Fishery2Metier> fishery2Metiers) 555 { 556 final Fishery entity = new FisheryImpl(); 557 entity.setLabel(label); 558 entity.setName(name); 559 entity.setDescription(description); 560 entity.setUpdateDate(updateDate); 561 entity.setComments(comments); 562 entity.setFishery2TaxonGroups(fishery2TaxonGroups); 563 entity.setFishery2Groupings(fishery2Groupings); 564 entity.setCorpuses(corpuses); 565 entity.setRegulationAreas(regulationAreas); 566 entity.setFishery2Gears(fishery2Gears); 567 entity.setFishery2Metiers(fishery2Metiers); 568 return entity; 569 } 570 } 571 572 /** 573 * @see Comparable#compareTo 574 */ 575 public int compareTo(Fishery o) 576 { 577 int cmp = 0; 578 if (this.getId() != null) 579 { 580 cmp = this.getId().compareTo(o.getId()); 581 } 582 else 583 { 584 if (this.getLabel() != null) 585 { 586 cmp = (cmp != 0 ? cmp : this.getLabel().compareTo(o.getLabel())); 587 } 588 if (this.getName() != null) 589 { 590 cmp = (cmp != 0 ? cmp : this.getName().compareTo(o.getName())); 591 } 592 if (this.getDescription() != null) 593 { 594 cmp = (cmp != 0 ? cmp : this.getDescription().compareTo(o.getDescription())); 595 } 596 if (this.getUpdateDate() != null) 597 { 598 cmp = (cmp != 0 ? cmp : this.getUpdateDate().compareTo(o.getUpdateDate())); 599 } 600 if (this.getComments() != null) 601 { 602 cmp = (cmp != 0 ? cmp : this.getComments().compareTo(o.getComments())); 603 } 604 } 605 return cmp; 606 } 607// HibernateEntity.vsl merge-point 608// Fishery.java merge-point 609}