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.data.vessel; 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 fr.ifremer.adagio.core.dao.administration.programStrategy.Program; 032import fr.ifremer.adagio.core.dao.data.vessel.regulation.RightToProduce; 033import fr.ifremer.adagio.core.dao.referential.location.Location; 034import java.io.Serializable; 035import java.sql.Timestamp; 036import java.util.Collection; 037import java.util.Date; 038import java.util.HashSet; 039 040/** 041 * <html> 042 * <head> 043 * </head> 044 * <body> 045 * <p> 046 * Armateur (ou propriétaire) de navire(s). Personne physique ou morale. 047 * </p> 048 * <p> 049 * </p> 050 * <p> 051 * Dans le cas de pecheur à pied ou groupement de navires, <i>VesselOwner</i> 052 * permet aussi de porter les informations sur le pecheur à pied, ou sur le 053 * responsable du groupement de navire. 054 * </p> 055 * <p> 056 * </p> 057 * <p> 058 * Nombre de lignes : 20900 059 * </p> 060 * </body> 061 * </html> 062 */ 063// HibernateEntity.vsl annotations merge-point 064public abstract class VesselOwner 065 implements Serializable, Comparable<VesselOwner> 066{ 067 /** 068 * The serial version UID of this class. Needed for serialization. 069 */ 070 private static final long serialVersionUID = -6371777362284854411L; 071 072 // Generate 17 attributes 073 private Integer id; 074 075 /** 076 * 077 * @return this.id Integer 078 */ 079 public Integer getId() 080 { 081 return this.id; 082 } 083 084 /** 085 * 086 * @param idIn Integer 087 */ 088 public void setId(Integer idIn) 089 { 090 this.id = idIn; 091 } 092 093 private String registrationCode; 094 095 /** 096 * Code administratif identifiant le propriétaire. Généralement unique par pays. 097 * En france : code affecté par la direction des peche. 098 * Dans certains pays, cela peut etre le numéro de la carte d'identité (ID card number). 099 * @return this.registrationCode String 100 */ 101 public String getRegistrationCode() 102 { 103 return this.registrationCode; 104 } 105 106 /** 107 * Code administratif identifiant le propriétaire. Généralement unique par pays. 108 * En france : code affecté par la direction des peche. 109 * Dans certains pays, cela peut etre le numéro de la carte d'identité (ID card number). 110 * @param registrationCodeIn String 111 */ 112 public void setRegistrationCode(String registrationCodeIn) 113 { 114 this.registrationCode = registrationCodeIn; 115 } 116 117 private String lastname; 118 119 /** 120 * 121 * @return this.lastname String 122 */ 123 public String getLastname() 124 { 125 return this.lastname; 126 } 127 128 /** 129 * 130 * @param lastnameIn String 131 */ 132 public void setLastname(String lastnameIn) 133 { 134 this.lastname = lastnameIn; 135 } 136 137 private String firstname; 138 139 /** 140 * 141 * @return this.firstname String 142 */ 143 public String getFirstname() 144 { 145 return this.firstname; 146 } 147 148 /** 149 * 150 * @param firstnameIn String 151 */ 152 public void setFirstname(String firstnameIn) 153 { 154 this.firstname = firstnameIn; 155 } 156 157 private String street; 158 159 /** 160 * Rue de l'armateur 161 * @return this.street String 162 */ 163 public String getStreet() 164 { 165 return this.street; 166 } 167 168 /** 169 * Rue de l'armateur 170 * @param streetIn String 171 */ 172 public void setStreet(String streetIn) 173 { 174 this.street = streetIn; 175 } 176 177 private String zipCode; 178 179 /** 180 * code postale de l'armateur 181 * @return this.zipCode String 182 */ 183 public String getZipCode() 184 { 185 return this.zipCode; 186 } 187 188 /** 189 * code postale de l'armateur 190 * @param zipCodeIn String 191 */ 192 public void setZipCode(String zipCodeIn) 193 { 194 this.zipCode = zipCodeIn; 195 } 196 197 private String city; 198 199 /** 200 * Ville de l'armateur 201 * @return this.city String 202 */ 203 public String getCity() 204 { 205 return this.city; 206 } 207 208 /** 209 * Ville de l'armateur 210 * @param cityIn String 211 */ 212 public void setCity(String cityIn) 213 { 214 this.city = cityIn; 215 } 216 217 private String address; 218 219 /** 220 * <html> 221 * <head> 222 * </head> 223 * <body> 224 * <p> 225 * Adresse de l'armateur (<u>calculé</u> automatiquement à partir de 226 * street, zipCode et city) 227 * </p> 228 * </body> 229 * </html> 230 * @return this.address String 231 */ 232 public String getAddress() 233 { 234 return this.address; 235 } 236 237 /** 238 * <html> 239 * <head> 240 * </head> 241 * <body> 242 * <p> 243 * Adresse de l'armateur (<u>calculé</u> automatiquement à partir de 244 * street, zipCode et city) 245 * </p> 246 * </body> 247 * </html> 248 * @param addressIn String 249 */ 250 public void setAddress(String addressIn) 251 { 252 this.address = addressIn; 253 } 254 255 private Date dateOfBirth; 256 257 /** 258 * Date de naissance de l'armateur 259 * @return this.dateOfBirth Date 260 */ 261 public Date getDateOfBirth() 262 { 263 return this.dateOfBirth; 264 } 265 266 /** 267 * Date de naissance de l'armateur 268 * @param dateOfBirthIn Date 269 */ 270 public void setDateOfBirth(Date dateOfBirthIn) 271 { 272 this.dateOfBirth = dateOfBirthIn; 273 } 274 275 private Date retirementDate; 276 277 /** 278 * Date du dernier jour d'activité (retraite) 279 * @return this.retirementDate Date 280 */ 281 public Date getRetirementDate() 282 { 283 return this.retirementDate; 284 } 285 286 /** 287 * Date du dernier jour d'activité (retraite) 288 * @param retirementDateIn Date 289 */ 290 public void setRetirementDate(Date retirementDateIn) 291 { 292 this.retirementDate = retirementDateIn; 293 } 294 295 private Boolean isInRetirement = Boolean.valueOf(false); 296 297 /** 298 * L'armateur est il en retraite, à la date du système (calculé à partir de la date 299 * retirementDate) 300 * @return this.isInRetirement Boolean 301 */ 302 public Boolean getIsInRetirement() 303 { 304 return this.isInRetirement; 305 } 306 307 /** 308 * L'armateur est il en retraite, à la date du système (calculé à partir de la date 309 * retirementDate) 310 * @param isInRetirementIn Boolean 311 */ 312 public void setIsInRetirement(Boolean isInRetirementIn) 313 { 314 this.isInRetirement = isInRetirementIn; 315 } 316 317 private Timestamp updateDate; 318 319 /** 320 * 321 * @return this.updateDate Timestamp 322 */ 323 public Timestamp getUpdateDate() 324 { 325 return this.updateDate; 326 } 327 328 /** 329 * 330 * @param updateDateIn Timestamp 331 */ 332 public void setUpdateDate(Timestamp updateDateIn) 333 { 334 this.updateDate = updateDateIn; 335 } 336 337 private String phoneNumber; 338 339 /** 340 * 341 * @return this.phoneNumber String 342 */ 343 public String getPhoneNumber() 344 { 345 return this.phoneNumber; 346 } 347 348 /** 349 * 350 * @param phoneNumberIn String 351 */ 352 public void setPhoneNumber(String phoneNumberIn) 353 { 354 this.phoneNumber = phoneNumberIn; 355 } 356 357 private String mobileNumber; 358 359 /** 360 * 361 * @return this.mobileNumber String 362 */ 363 public String getMobileNumber() 364 { 365 return this.mobileNumber; 366 } 367 368 /** 369 * 370 * @param mobileNumberIn String 371 */ 372 public void setMobileNumber(String mobileNumberIn) 373 { 374 this.mobileNumber = mobileNumberIn; 375 } 376 377 private String faxNumber; 378 379 /** 380 * 381 * @return this.faxNumber String 382 */ 383 public String getFaxNumber() 384 { 385 return this.faxNumber; 386 } 387 388 /** 389 * 390 * @param faxNumberIn String 391 */ 392 public void setFaxNumber(String faxNumberIn) 393 { 394 this.faxNumber = faxNumberIn; 395 } 396 397 private String email; 398 399 /** 400 * 401 * @return this.email String 402 */ 403 public String getEmail() 404 { 405 return this.email; 406 } 407 408 /** 409 * 410 * @param emailIn String 411 */ 412 public void setEmail(String emailIn) 413 { 414 this.email = emailIn; 415 } 416 417 private Date activityStartDate; 418 419 /** 420 * Date de début d'activité de la personne, en tant qu'armateur. 421 * @return this.activityStartDate Date 422 */ 423 public Date getActivityStartDate() 424 { 425 return this.activityStartDate; 426 } 427 428 /** 429 * Date de début d'activité de la personne, en tant qu'armateur. 430 * @param activityStartDateIn Date 431 */ 432 public void setActivityStartDate(Date activityStartDateIn) 433 { 434 this.activityStartDate = activityStartDateIn; 435 } 436 437 // Generate 6 associations 438 private Program program; 439 440 /** 441 * <html> 442 * <head> 443 * <style> 444 * p {padding:0px; margin:0px;} 445 * </style> 446 * </head> 447 * <body> 448 * <p> 449 * Identifie le programme de collecte à l'origine des informations sur 450 * l'armateur. 451 * </p> 452 * <p> 453 * </p> 454 * <p> 455 * Ce programme de collecte peut être différent de celui du <i>Vessel</i>. 456 * </p> 457 * </body> 458 * </html> 459 * @return this.program Program 460 */ 461 public Program getProgram() 462 { 463 return this.program; 464 } 465 466 /** 467 * <html> 468 * <head> 469 * <style> 470 * p {padding:0px; margin:0px;} 471 * </style> 472 * </head> 473 * <body> 474 * <p> 475 * Identifie le programme de collecte à l'origine des informations sur 476 * l'armateur. 477 * </p> 478 * <p> 479 * </p> 480 * <p> 481 * Ce programme de collecte peut être différent de celui du <i>Vessel</i>. 482 * </p> 483 * </body> 484 * </html> 485 * @param programIn Program 486 */ 487 public void setProgram(Program programIn) 488 { 489 this.program = programIn; 490 } 491 492 private Location countryLocation; 493 494 /** 495 * Pays de résidence de l'armateur. 496 * Si non spécifié, alors l'armateur est résident dans le pays exploitant le SIH. 497 * @return this.countryLocation Location 498 */ 499 public Location getCountryLocation() 500 { 501 return this.countryLocation; 502 } 503 504 /** 505 * Pays de résidence de l'armateur. 506 * Si non spécifié, alors l'armateur est résident dans le pays exploitant le SIH. 507 * @param countryLocationIn Location 508 */ 509 public void setCountryLocation(Location countryLocationIn) 510 { 511 this.countryLocation = countryLocationIn; 512 } 513 514 private Collection<RightToProduce> rightToProduces = new HashSet<RightToProduce>(); 515 516 /** 517 * Un droit de produire est une autorisation administrative pour prélever de ou exploiter de la 518 * ressource. Il peut concerner un ensemble de navires de peche, ou un seul navire ou pecheur à 519 * pied. 520 * L'autorisation peut etre relative à une espèce, ou bien à un couple engin/espèce (=métier) 521 * il peut etre défini dans le cadre d'un corpus ou non (ex : droit de produire défini par les 522 * autorités locales). 523 * @return this.rightToProduces Collection<RightToProduce> 524 */ 525 public Collection<RightToProduce> getRightToProduces() 526 { 527 return this.rightToProduces; 528 } 529 530 /** 531 * Un droit de produire est une autorisation administrative pour prélever de ou exploiter de la 532 * ressource. Il peut concerner un ensemble de navires de peche, ou un seul navire ou pecheur à 533 * pied. 534 * L'autorisation peut etre relative à une espèce, ou bien à un couple engin/espèce (=métier) 535 * il peut etre défini dans le cadre d'un corpus ou non (ex : droit de produire défini par les 536 * autorités locales). 537 * @param rightToProducesIn Collection<RightToProduce> 538 */ 539 public void setRightToProduces(Collection<RightToProduce> rightToProducesIn) 540 { 541 this.rightToProduces = rightToProducesIn; 542 } 543 544 /** 545 * Un droit de produire est une autorisation administrative pour prélever de ou exploiter de la 546 * ressource. Il peut concerner un ensemble de navires de peche, ou un seul navire ou pecheur à 547 * pied. 548 * L'autorisation peut etre relative à une espèce, ou bien à un couple engin/espèce (=métier) 549 * il peut etre défini dans le cadre d'un corpus ou non (ex : droit de produire défini par les 550 * autorités locales). 551 * @param elementToAdd RightToProduce 552 * @return <tt>true</tt> if this collection changed as a result of the 553 * call 554 */ 555 public boolean addRightToProduces(RightToProduce elementToAdd) 556 { 557 return this.rightToProduces.add(elementToAdd); 558 } 559 560 /** 561 * Un droit de produire est une autorisation administrative pour prélever de ou exploiter de la 562 * ressource. Il peut concerner un ensemble de navires de peche, ou un seul navire ou pecheur à 563 * pied. 564 * L'autorisation peut etre relative à une espèce, ou bien à un couple engin/espèce (=métier) 565 * il peut etre défini dans le cadre d'un corpus ou non (ex : droit de produire défini par les 566 * autorités locales). 567 * @param elementToRemove RightToProduce 568 * @return <tt>true</tt> if this collection changed as a result of the 569 * call 570 */ 571 public boolean removeRightToProduces(RightToProduce elementToRemove) 572 { 573 return this.rightToProduces.remove(elementToRemove); 574 } 575 576 /** 577 * Returns <code>true</code> if the argument is an VesselOwner instance and all identifiers for this entity 578 * equal the identifiers of the argument entity. Returns <code>false</code> otherwise. 579 */ 580 @Override 581 public boolean equals(Object object) 582 { 583 if (this == object) 584 { 585 return true; 586 } 587 if (!(object instanceof VesselOwner)) 588 { 589 return false; 590 } 591 final VesselOwner that = (VesselOwner)object; 592 if (this.id == null || that.getId() == null || !this.id.equals(that.getId())) 593 { 594 return false; 595 } 596 return true; 597 } 598 599 /** 600 * Returns a hash code based on this entity's identifiers. 601 */ 602 @Override 603 public int hashCode() 604 { 605 int hashCode = 0; 606 hashCode = 29 * hashCode + (this.id == null ? 0 : this.id.hashCode()); 607 608 return hashCode; 609 } 610 611 /** 612 * Constructs new instances of {@link VesselOwner}. 613 */ 614 public static final class Factory 615 { 616 /** 617 * Constructs a new instance of {@link VesselOwner}. 618 * @return new VesselOwnerImpl() 619 */ 620 public static VesselOwner newInstance() 621 { 622 return new VesselOwnerImpl(); 623 } 624 625 /** 626 * Constructs a new instance of {@link VesselOwner}, taking all required and/or 627 * read-only properties as arguments, except for identifiers. 628 * @param updateDate Timestamp 629 * @param program Program 630 * @return newInstance 631 */ 632 public static VesselOwner newInstance(Timestamp updateDate, Program program) 633 { 634 final VesselOwner entity = new VesselOwnerImpl(); 635 entity.setUpdateDate(updateDate); 636 entity.setProgram(program); 637 return entity; 638 } 639 640 /** 641 * Constructs a new instance of {@link VesselOwner}, taking all possible properties 642 * (except the identifier(s))as arguments. 643 * @param registrationCode String 644 * @param lastname String 645 * @param firstname String 646 * @param street String 647 * @param zipCode String 648 * @param city String 649 * @param address String 650 * @param dateOfBirth Date 651 * @param retirementDate Date 652 * @param isInRetirement Boolean 653 * @param updateDate Timestamp 654 * @param phoneNumber String 655 * @param mobileNumber String 656 * @param faxNumber String 657 * @param email String 658 * @param activityStartDate Date 659 * @param program Program 660 * @param countryLocation Location 661 * @param rightToProduces Collection<RightToProduce> 662 * @return newInstance VesselOwner 663 */ 664 public static VesselOwner newInstance(String registrationCode, String lastname, String firstname, String street, String zipCode, String city, String address, Date dateOfBirth, Date retirementDate, Boolean isInRetirement, Timestamp updateDate, String phoneNumber, String mobileNumber, String faxNumber, String email, Date activityStartDate, Program program, Location countryLocation, Collection<RightToProduce> rightToProduces) 665 { 666 final VesselOwner entity = new VesselOwnerImpl(); 667 entity.setRegistrationCode(registrationCode); 668 entity.setLastname(lastname); 669 entity.setFirstname(firstname); 670 entity.setStreet(street); 671 entity.setZipCode(zipCode); 672 entity.setCity(city); 673 entity.setAddress(address); 674 entity.setDateOfBirth(dateOfBirth); 675 entity.setRetirementDate(retirementDate); 676 entity.setIsInRetirement(isInRetirement); 677 entity.setUpdateDate(updateDate); 678 entity.setPhoneNumber(phoneNumber); 679 entity.setMobileNumber(mobileNumber); 680 entity.setFaxNumber(faxNumber); 681 entity.setEmail(email); 682 entity.setActivityStartDate(activityStartDate); 683 entity.setProgram(program); 684 entity.setCountryLocation(countryLocation); 685 entity.setRightToProduces(rightToProduces); 686 return entity; 687 } 688 } 689 690 /** 691 * @see Comparable#compareTo 692 */ 693 public int compareTo(VesselOwner o) 694 { 695 int cmp = 0; 696 if (this.getId() != null) 697 { 698 cmp = this.getId().compareTo(o.getId()); 699 } 700 else 701 { 702 if (this.getRegistrationCode() != null) 703 { 704 cmp = (cmp != 0 ? cmp : this.getRegistrationCode().compareTo(o.getRegistrationCode())); 705 } 706 if (this.getLastname() != null) 707 { 708 cmp = (cmp != 0 ? cmp : this.getLastname().compareTo(o.getLastname())); 709 } 710 if (this.getFirstname() != null) 711 { 712 cmp = (cmp != 0 ? cmp : this.getFirstname().compareTo(o.getFirstname())); 713 } 714 if (this.getStreet() != null) 715 { 716 cmp = (cmp != 0 ? cmp : this.getStreet().compareTo(o.getStreet())); 717 } 718 if (this.getZipCode() != null) 719 { 720 cmp = (cmp != 0 ? cmp : this.getZipCode().compareTo(o.getZipCode())); 721 } 722 if (this.getCity() != null) 723 { 724 cmp = (cmp != 0 ? cmp : this.getCity().compareTo(o.getCity())); 725 } 726 if (this.getAddress() != null) 727 { 728 cmp = (cmp != 0 ? cmp : this.getAddress().compareTo(o.getAddress())); 729 } 730 if (this.getDateOfBirth() != null) 731 { 732 cmp = (cmp != 0 ? cmp : this.getDateOfBirth().compareTo(o.getDateOfBirth())); 733 } 734 if (this.getRetirementDate() != null) 735 { 736 cmp = (cmp != 0 ? cmp : this.getRetirementDate().compareTo(o.getRetirementDate())); 737 } 738 if (this.getIsInRetirement() != null) 739 { 740 cmp = (cmp != 0 ? cmp : this.getIsInRetirement().compareTo(o.getIsInRetirement())); 741 } 742 if (this.getUpdateDate() != null) 743 { 744 cmp = (cmp != 0 ? cmp : this.getUpdateDate().compareTo(o.getUpdateDate())); 745 } 746 if (this.getPhoneNumber() != null) 747 { 748 cmp = (cmp != 0 ? cmp : this.getPhoneNumber().compareTo(o.getPhoneNumber())); 749 } 750 if (this.getMobileNumber() != null) 751 { 752 cmp = (cmp != 0 ? cmp : this.getMobileNumber().compareTo(o.getMobileNumber())); 753 } 754 if (this.getFaxNumber() != null) 755 { 756 cmp = (cmp != 0 ? cmp : this.getFaxNumber().compareTo(o.getFaxNumber())); 757 } 758 if (this.getEmail() != null) 759 { 760 cmp = (cmp != 0 ? cmp : this.getEmail().compareTo(o.getEmail())); 761 } 762 if (this.getActivityStartDate() != null) 763 { 764 cmp = (cmp != 0 ? cmp : this.getActivityStartDate().compareTo(o.getActivityStartDate())); 765 } 766 } 767 return cmp; 768 } 769// HibernateEntity.vsl merge-point 770// VesselOwner.java merge-point 771}