1 // license-header java merge-point
2 //
3 // Attention: Generated code! Do not modify by hand!
4 // Generated by: hibernate/HibernateEntity.vsl in andromda-hibernate-cartridge.
5 //
6 package fr.ifremer.quadrige3.core.dao.referential.taxon;
7
8 /*-
9 * #%L
10 * Quadrige3 Core :: Client API
11 * %%
12 * Copyright (C) 2017 - 2024 Ifremer
13 * %%
14 * This program is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Affero General Public License as published by
16 * the Free Software Foundation, either version 3 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU Affero General Public License
25 * along with this program. If not, see <http://www.gnu.org/licenses/>.
26 * #L%
27 */
28 import java.io.Serializable;
29 import java.sql.Timestamp;
30 import java.util.Collection;
31 import java.util.Date;
32 import java.util.HashSet;
33
34 /**
35 * Liste les taxons (interface avec ERMS)
36 */
37 // HibernateEntity.vsl annotations merge-point
38 public abstract class TaxonName
39 implements Serializable, Comparable<TaxonName>
40 {
41 /**
42 * The serial version UID of this class. Needed for serialization.
43 */
44 private static final long serialVersionUID = -2916293180423349086L;
45
46 // Generate 14 attributes
47 private Integer taxonNameId;
48
49 /**
50 * Identifiant interne du taxon
51 * @return this.taxonNameId Integer
52 */
53 public Integer getTaxonNameId()
54 {
55 return this.taxonNameId;
56 }
57
58 /**
59 * Identifiant interne du taxon
60 * @param taxonNameIdIn Integer
61 */
62 public void setTaxonNameId(Integer taxonNameIdIn)
63 {
64 this.taxonNameId = taxonNameIdIn;
65 }
66
67 private String taxonNameNm;
68
69 /**
70 * Nom scientifique du taxon, unique pour le niveau
71 * @return this.taxonNameNm String
72 */
73 public String getTaxonNameNm()
74 {
75 return this.taxonNameNm;
76 }
77
78 /**
79 * Nom scientifique du taxon, unique pour le niveau
80 * @param taxonNameNmIn String
81 */
82 public void setTaxonNameNm(String taxonNameNmIn)
83 {
84 this.taxonNameNm = taxonNameNmIn;
85 }
86
87 private String taxonNameCompleteNm;
88
89 /**
90 * Nom concaténé du taxon
91 * @return this.taxonNameCompleteNm String
92 */
93 public String getTaxonNameCompleteNm()
94 {
95 return this.taxonNameCompleteNm;
96 }
97
98 /**
99 * Nom concaténé du taxon
100 * @param taxonNameCompleteNmIn String
101 */
102 public void setTaxonNameCompleteNm(String taxonNameCompleteNmIn)
103 {
104 this.taxonNameCompleteNm = taxonNameCompleteNmIn;
105 }
106
107 private Boolean taxonNameIsNaming;
108
109 /**
110 * Indique si le taxon respecte les règles de nommage
111 * @return this.taxonNameIsNaming Boolean
112 */
113 public Boolean getTaxonNameIsNaming()
114 {
115 return this.taxonNameIsNaming;
116 }
117
118 /**
119 * Indique si le taxon respecte les règles de nommage
120 * @param taxonNameIsNamingIn Boolean
121 */
122 public void setTaxonNameIsNaming(Boolean taxonNameIsNamingIn)
123 {
124 this.taxonNameIsNaming = taxonNameIsNamingIn;
125 }
126
127 private String taxonNameCm;
128
129 /**
130 * Commentaire sur le taxon
131 * @return this.taxonNameCm String
132 */
133 public String getTaxonNameCm()
134 {
135 return this.taxonNameCm;
136 }
137
138 /**
139 * Commentaire sur le taxon
140 * @param taxonNameCmIn String
141 */
142 public void setTaxonNameCm(String taxonNameCmIn)
143 {
144 this.taxonNameCm = taxonNameCmIn;
145 }
146
147 private Integer taxonNameUpperRk;
148
149 /**
150 * Rang du taxon parmis les fils d'un même père pour classement
151 * @return this.taxonNameUpperRk Integer
152 */
153 public Integer getTaxonNameUpperRk()
154 {
155 return this.taxonNameUpperRk;
156 }
157
158 /**
159 * Rang du taxon parmis les fils d'un même père pour classement
160 * @param taxonNameUpperRkIn Integer
161 */
162 public void setTaxonNameUpperRk(Integer taxonNameUpperRkIn)
163 {
164 this.taxonNameUpperRk = taxonNameUpperRkIn;
165 }
166
167 private Boolean taxonNameIsRefer;
168
169 /**
170 * Vrai si le taxon est le taxon référent, faux pour les synonymes.
171 * @return this.taxonNameIsRefer Boolean
172 */
173 public Boolean getTaxonNameIsRefer()
174 {
175 return this.taxonNameIsRefer;
176 }
177
178 /**
179 * Vrai si le taxon est le taxon référent, faux pour les synonymes.
180 * @param taxonNameIsReferIn Boolean
181 */
182 public void setTaxonNameIsRefer(Boolean taxonNameIsReferIn)
183 {
184 this.taxonNameIsRefer = taxonNameIsReferIn;
185 }
186
187 private Boolean taxonNameIsVirtual;
188
189 /**
190 * Indique si le taxon est virtuel ou non
191 * @return this.taxonNameIsVirtual Boolean
192 */
193 public Boolean getTaxonNameIsVirtual()
194 {
195 return this.taxonNameIsVirtual;
196 }
197
198 /**
199 * Indique si le taxon est virtuel ou non
200 * @param taxonNameIsVirtualIn Boolean
201 */
202 public void setTaxonNameIsVirtual(Boolean taxonNameIsVirtualIn)
203 {
204 this.taxonNameIsVirtual = taxonNameIsVirtualIn;
205 }
206
207 private Boolean taxonNameObsol;
208
209 /**
210 * Vrai si le taxon est devenu obsolète, il doit plus être proposé dans les listes de saisie
211 * @return this.taxonNameObsol Boolean
212 */
213 public Boolean getTaxonNameObsol()
214 {
215 return this.taxonNameObsol;
216 }
217
218 /**
219 * Vrai si le taxon est devenu obsolète, il doit plus être proposé dans les listes de saisie
220 * @param taxonNameObsolIn Boolean
221 */
222 public void setTaxonNameObsol(Boolean taxonNameObsolIn)
223 {
224 this.taxonNameObsol = taxonNameObsolIn;
225 }
226
227 private Boolean taxonNameTempor;
228
229 /**
230 * Vrai s'il s'agit d'une identification provisoire.
231 * @return this.taxonNameTempor Boolean
232 */
233 public Boolean getTaxonNameTempor()
234 {
235 return this.taxonNameTempor;
236 }
237
238 /**
239 * Vrai s'il s'agit d'une identification provisoire.
240 * @param taxonNameTemporIn Boolean
241 */
242 public void setTaxonNameTempor(Boolean taxonNameTemporIn)
243 {
244 this.taxonNameTempor = taxonNameTemporIn;
245 }
246
247 private Date taxonNameCreationDt;
248
249 /**
250 * Date de création de l'objet
251 * @return this.taxonNameCreationDt Date
252 */
253 public Date getTaxonNameCreationDt()
254 {
255 return this.taxonNameCreationDt;
256 }
257
258 /**
259 * Date de création de l'objet
260 * @param taxonNameCreationDtIn Date
261 */
262 public void setTaxonNameCreationDt(Date taxonNameCreationDtIn)
263 {
264 this.taxonNameCreationDt = taxonNameCreationDtIn;
265 }
266
267 private Timestamp updateDt;
268
269 /**
270 * Date de mise à jour de l'objet
271 * @return this.updateDt Timestamp
272 */
273 public Timestamp getUpdateDt()
274 {
275 return this.updateDt;
276 }
277
278 /**
279 * Date de mise à jour de l'objet
280 * @param updateDtIn Timestamp
281 */
282 public void setUpdateDt(Timestamp updateDtIn)
283 {
284 this.updateDt = updateDtIn;
285 }
286
287 private Date taxonStartDt;
288
289 /**
290 * Date de début de validité du taxon
291 * @return this.taxonStartDt Date
292 */
293 public Date getTaxonStartDt()
294 {
295 return this.taxonStartDt;
296 }
297
298 /**
299 * Date de début de validité du taxon
300 * @param taxonStartDtIn Date
301 */
302 public void setTaxonStartDt(Date taxonStartDtIn)
303 {
304 this.taxonStartDt = taxonStartDtIn;
305 }
306
307 private Date taxonEndDt;
308
309 /**
310 * Date de fin de validité du taxon
311 * @return this.taxonEndDt Date
312 */
313 public Date getTaxonEndDt()
314 {
315 return this.taxonEndDt;
316 }
317
318 /**
319 * Date de fin de validité du taxon
320 * @param taxonEndDtIn Date
321 */
322 public void setTaxonEndDt(Date taxonEndDtIn)
323 {
324 this.taxonEndDt = taxonEndDtIn;
325 }
326
327 // Generate 11 associations
328 private Citation citId;
329
330 /**
331 * Citation faisant référence pour un taxon particulier.
332 * @return this.citId Citation
333 */
334 public Citation getCitId()
335 {
336 return this.citId;
337 }
338
339 /**
340 * Citation faisant référence pour un taxon particulier.
341 * @param citIdIn Citation
342 */
343 public void setCitId(Citation citIdIn)
344 {
345 this.citId = citIdIn;
346 }
347
348 private Collection<AlternativeTaxon> alternativeTaxons = new HashSet<AlternativeTaxon>();
349
350 /**
351 * Contient les correspondances entre les taxons du système et les codes alternatifs des taxons
352 * provenant d'autres sources (autres systèmes, référentiels...)
353 * @return this.alternativeTaxons Collection<AlternativeTaxon>
354 */
355 public Collection<AlternativeTaxon> getAlternativeTaxons()
356 {
357 return this.alternativeTaxons;
358 }
359
360 /**
361 * Contient les correspondances entre les taxons du système et les codes alternatifs des taxons
362 * provenant d'autres sources (autres systèmes, référentiels...)
363 * @param alternativeTaxonsIn Collection<AlternativeTaxon>
364 */
365 public void setAlternativeTaxons(Collection<AlternativeTaxon> alternativeTaxonsIn)
366 {
367 this.alternativeTaxons = alternativeTaxonsIn;
368 }
369
370 /**
371 * Contient les correspondances entre les taxons du système et les codes alternatifs des taxons
372 * provenant d'autres sources (autres systèmes, référentiels...)
373 * @param elementToAdd AlternativeTaxon
374 * @return <tt>true</tt> if this collection changed as a result of the
375 * call
376 */
377 public boolean addAlternativeTaxons(AlternativeTaxon elementToAdd)
378 {
379 return this.alternativeTaxons.add(elementToAdd);
380 }
381
382 /**
383 * Contient les correspondances entre les taxons du système et les codes alternatifs des taxons
384 * provenant d'autres sources (autres systèmes, référentiels...)
385 * @param elementToRemove AlternativeTaxon
386 * @return <tt>true</tt> if this collection changed as a result of the
387 * call
388 */
389 public boolean removeAlternativeTaxons(AlternativeTaxon elementToRemove)
390 {
391 return this.alternativeTaxons.remove(elementToRemove);
392 }
393
394 private Collection<TaxonNameHistory> taxonNameHistories = new HashSet<TaxonNameHistory>();
395
396 /**
397 * Cette table permet de conserver l'historique des modifications d'un taxon
398 * @return this.taxonNameHistories Collection<TaxonNameHistory>
399 */
400 public Collection<TaxonNameHistory> getTaxonNameHistories()
401 {
402 return this.taxonNameHistories;
403 }
404
405 /**
406 * Cette table permet de conserver l'historique des modifications d'un taxon
407 * @param taxonNameHistoriesIn Collection<TaxonNameHistory>
408 */
409 public void setTaxonNameHistories(Collection<TaxonNameHistory> taxonNameHistoriesIn)
410 {
411 this.taxonNameHistories = taxonNameHistoriesIn;
412 }
413
414 /**
415 * Cette table permet de conserver l'historique des modifications d'un taxon
416 * @param elementToAdd TaxonNameHistory
417 * @return <tt>true</tt> if this collection changed as a result of the
418 * call
419 */
420 public boolean addTaxonNameHistories(TaxonNameHistory elementToAdd)
421 {
422 return this.taxonNameHistories.add(elementToAdd);
423 }
424
425 /**
426 * Cette table permet de conserver l'historique des modifications d'un taxon
427 * @param elementToRemove TaxonNameHistory
428 * @return <tt>true</tt> if this collection changed as a result of the
429 * call
430 */
431 public boolean removeTaxonNameHistories(TaxonNameHistory elementToRemove)
432 {
433 return this.taxonNameHistories.remove(elementToRemove);
434 }
435
436 private Collection<TaxonName> taxonNames = new HashSet<TaxonName>();
437
438 /**
439 * Liste les taxons (interface avec ERMS)
440 * @return this.taxonNames Collection<TaxonName>
441 */
442 public Collection<TaxonName> getTaxonNames()
443 {
444 return this.taxonNames;
445 }
446
447 /**
448 * Liste les taxons (interface avec ERMS)
449 * @param taxonNamesIn Collection<TaxonName>
450 */
451 public void setTaxonNames(Collection<TaxonName> taxonNamesIn)
452 {
453 this.taxonNames = taxonNamesIn;
454 }
455
456 /**
457 * Liste les taxons (interface avec ERMS)
458 * @param elementToAdd TaxonName
459 * @return <tt>true</tt> if this collection changed as a result of the
460 * call
461 */
462 public boolean addTaxonNames(TaxonName elementToAdd)
463 {
464 return this.taxonNames.add(elementToAdd);
465 }
466
467 /**
468 * Liste les taxons (interface avec ERMS)
469 * @param elementToRemove TaxonName
470 * @return <tt>true</tt> if this collection changed as a result of the
471 * call
472 */
473 public boolean removeTaxonNames(TaxonName elementToRemove)
474 {
475 return this.taxonNames.remove(elementToRemove);
476 }
477
478 private TaxonName parentTaxonName;
479
480 /**
481 * Liste les taxons (interface avec ERMS)
482 * @return this.parentTaxonName TaxonName
483 */
484 public TaxonName getParentTaxonName()
485 {
486 return this.parentTaxonName;
487 }
488
489 /**
490 * Liste les taxons (interface avec ERMS)
491 * @param parentTaxonNameIn TaxonName
492 */
493 public void setParentTaxonName(TaxonName parentTaxonNameIn)
494 {
495 this.parentTaxonName = parentTaxonNameIn;
496 }
497
498 private TaxonomicLevel taxonomicLevel;
499
500 /**
501 * Liste des niveaux systématiques des taxons.
502 * @return this.taxonomicLevel TaxonomicLevel
503 */
504 public TaxonomicLevel getTaxonomicLevel()
505 {
506 return this.taxonomicLevel;
507 }
508
509 /**
510 * Liste des niveaux systématiques des taxons.
511 * @param taxonomicLevelIn TaxonomicLevel
512 */
513 public void setTaxonomicLevel(TaxonomicLevel taxonomicLevelIn)
514 {
515 this.taxonomicLevel = taxonomicLevelIn;
516 }
517
518 private Collection<TaxonGroupHistoricalRecord> taxonGroupHistoricalRecords = new HashSet<TaxonGroupHistoricalRecord>();
519
520 /**
521 * Historique de l'évolution des contenus des groupes de taxons
522 * @return this.taxonGroupHistoricalRecords Collection<TaxonGroupHistoricalRecord>
523 */
524 public Collection<TaxonGroupHistoricalRecord> getTaxonGroupHistoricalRecords()
525 {
526 return this.taxonGroupHistoricalRecords;
527 }
528
529 /**
530 * Historique de l'évolution des contenus des groupes de taxons
531 * @param taxonGroupHistoricalRecordsIn Collection<TaxonGroupHistoricalRecord>
532 */
533 public void setTaxonGroupHistoricalRecords(Collection<TaxonGroupHistoricalRecord> taxonGroupHistoricalRecordsIn)
534 {
535 this.taxonGroupHistoricalRecords = taxonGroupHistoricalRecordsIn;
536 }
537
538 /**
539 * Historique de l'évolution des contenus des groupes de taxons
540 * @param elementToAdd TaxonGroupHistoricalRecord
541 * @return <tt>true</tt> if this collection changed as a result of the
542 * call
543 */
544 public boolean addTaxonGroupHistoricalRecords(TaxonGroupHistoricalRecord elementToAdd)
545 {
546 return this.taxonGroupHistoricalRecords.add(elementToAdd);
547 }
548
549 /**
550 * Historique de l'évolution des contenus des groupes de taxons
551 * @param elementToRemove TaxonGroupHistoricalRecord
552 * @return <tt>true</tt> if this collection changed as a result of the
553 * call
554 */
555 public boolean removeTaxonGroupHistoricalRecords(TaxonGroupHistoricalRecord elementToRemove)
556 {
557 return this.taxonGroupHistoricalRecords.remove(elementToRemove);
558 }
559
560 private ReferenceTaxon referenceTaxon;
561
562 /**
563 * Liste des taxons qui sont la référence.
564 * l'ID référent est indépendant des ID taxon car les taxons peuvent être référents à un moment
565 * et ne
566 * plus l'être par la suite.
567 * Toutes les données du système doivent donc être reliées au référent et non au taxon qui sont
568 * référents à un moment mais ne peuvent plus l'être par la suite.
569 * Le fonctionnement dans la table TAXON_NAME est le suivant :
570 * - REF_TAXON_ID est toujours renseigné
571 * - si TAXON_NAME_IS_REFER est à vrai, il s'agit d'un taxon référent (toujours le cas s'il
572 * s'agit d'un
573 * taxon virtuel)
574 * - sinon c'est un synonyme
575 * Un taxon référent qui devient synonyme voit donc son statut TAXON_NAME_IS_REFER changer et le
576 * nouveau taxon référent qui le remplace récupère l'information REF_TAXON_ID
577 * NB : c'était le comportement initialement prévu.
578 * En réalité, lorsqu'un taxon référent T1-R1 devient synonyme d'un nouveau taxon référent T2,
579 * le taxon
580 * T2 prend un nouveau code référent R2 et donc le taxon T1 est lié à R2 (et tous les synonymes
581 * et les
582 * résultats qu'il pouvait avoir).
583 * Ce mécanisme a été adopté car il fallait distinguer 2 cas :
584 * 1- cas d'un taxon référent T1-R1 qui devient synonyme d'un référent qu'on crée T2 : on aurait
585 * alors
586 * pu utiliser le même REF_TAXON_ID R1 au lieu d'en créer un et ne pas mettre à jour les autres
587 * synonymes, résultats...
588 * 2- cas d'un taxon référent T1-R1 qui devient synonyme d'un référent qui existe déjà T2-R2 (et
589 * qui
590 * aurait déjà d'autres synonymes, résultats...), dans ce cas le remplacement de la référence R1
591 * pour
592 * R2 est nécessaire
593 * La modélisation pourrait être revue car la table REFENCE_TAXON ne se justifie alors plus, on
594 * pourrait directement utiliser une référence à la colonne TAXON_NAME_ID pour désigner les
595 * référents
596 * @return this.referenceTaxon ReferenceTaxon
597 */
598 public ReferenceTaxon getReferenceTaxon()
599 {
600 return this.referenceTaxon;
601 }
602
603 /**
604 * Liste des taxons qui sont la référence.
605 * l'ID référent est indépendant des ID taxon car les taxons peuvent être référents à un moment
606 * et ne
607 * plus l'être par la suite.
608 * Toutes les données du système doivent donc être reliées au référent et non au taxon qui sont
609 * référents à un moment mais ne peuvent plus l'être par la suite.
610 * Le fonctionnement dans la table TAXON_NAME est le suivant :
611 * - REF_TAXON_ID est toujours renseigné
612 * - si TAXON_NAME_IS_REFER est à vrai, il s'agit d'un taxon référent (toujours le cas s'il
613 * s'agit d'un
614 * taxon virtuel)
615 * - sinon c'est un synonyme
616 * Un taxon référent qui devient synonyme voit donc son statut TAXON_NAME_IS_REFER changer et le
617 * nouveau taxon référent qui le remplace récupère l'information REF_TAXON_ID
618 * NB : c'était le comportement initialement prévu.
619 * En réalité, lorsqu'un taxon référent T1-R1 devient synonyme d'un nouveau taxon référent T2,
620 * le taxon
621 * T2 prend un nouveau code référent R2 et donc le taxon T1 est lié à R2 (et tous les synonymes
622 * et les
623 * résultats qu'il pouvait avoir).
624 * Ce mécanisme a été adopté car il fallait distinguer 2 cas :
625 * 1- cas d'un taxon référent T1-R1 qui devient synonyme d'un référent qu'on crée T2 : on aurait
626 * alors
627 * pu utiliser le même REF_TAXON_ID R1 au lieu d'en créer un et ne pas mettre à jour les autres
628 * synonymes, résultats...
629 * 2- cas d'un taxon référent T1-R1 qui devient synonyme d'un référent qui existe déjà T2-R2 (et
630 * qui
631 * aurait déjà d'autres synonymes, résultats...), dans ce cas le remplacement de la référence R1
632 * pour
633 * R2 est nécessaire
634 * La modélisation pourrait être revue car la table REFENCE_TAXON ne se justifie alors plus, on
635 * pourrait directement utiliser une référence à la colonne TAXON_NAME_ID pour désigner les
636 * référents
637 * @param referenceTaxonIn ReferenceTaxon
638 */
639 public void setReferenceTaxon(ReferenceTaxon referenceTaxonIn)
640 {
641 this.referenceTaxon = referenceTaxonIn;
642 }
643
644 private Collection<VirtualComponent> virtualComponents = new HashSet<VirtualComponent>();
645
646 /**
647 *
648 * @return this.virtualComponents Collection<VirtualComponent>
649 */
650 public Collection<VirtualComponent> getVirtualComponents()
651 {
652 return this.virtualComponents;
653 }
654
655 /**
656 *
657 * @param virtualComponentsIn Collection<VirtualComponent>
658 */
659 public void setVirtualComponents(Collection<VirtualComponent> virtualComponentsIn)
660 {
661 this.virtualComponents = virtualComponentsIn;
662 }
663
664 /**
665 *
666 * @param elementToAdd VirtualComponent
667 * @return <tt>true</tt> if this collection changed as a result of the
668 * call
669 */
670 public boolean addVirtualComponents(VirtualComponent elementToAdd)
671 {
672 return this.virtualComponents.add(elementToAdd);
673 }
674
675 /**
676 *
677 * @param elementToRemove VirtualComponent
678 * @return <tt>true</tt> if this collection changed as a result of the
679 * call
680 */
681 public boolean removeVirtualComponents(VirtualComponent elementToRemove)
682 {
683 return this.virtualComponents.remove(elementToRemove);
684 }
685
686 /**
687 * Returns <code>true</code> if the argument is an TaxonName instance and all identifiers for this entity
688 * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
689 */
690 @Override
691 public boolean equals(Object object)
692 {
693 if (this == object)
694 {
695 return true;
696 }
697 if (!(object instanceof TaxonName))
698 {
699 return false;
700 }
701 final TaxonName that = (TaxonName)object;
702 if (this.taxonNameId == null || that.getTaxonNameId() == null || !this.taxonNameId.equals(that.getTaxonNameId()))
703 {
704 return false;
705 }
706 return true;
707 }
708
709 /**
710 * Returns a hash code based on this entity's identifiers.
711 */
712 @Override
713 public int hashCode()
714 {
715 int hashCode = 0;
716 hashCode = 29 * hashCode + (this.taxonNameId == null ? 0 : this.taxonNameId.hashCode());
717
718 return hashCode;
719 }
720
721 /**
722 * Constructs new instances of {@link TaxonName}.
723 */
724 public static final class Factory
725 {
726 /**
727 * Constructs a new instance of {@link TaxonName}.
728 * @return new TaxonNameImpl()
729 */
730 public static TaxonName newInstance()
731 {
732 return new TaxonNameImpl();
733 }
734
735 /**
736 * Constructs a new instance of {@link TaxonName}, taking all required and/or
737 * read-only properties as arguments, except for identifiers.
738 * @param taxonomicLevel TaxonomicLevel
739 * @param referenceTaxon ReferenceTaxon
740 * @return newInstance
741 */
742 public static TaxonName newInstance(TaxonomicLevel taxonomicLevel, ReferenceTaxon referenceTaxon)
743 {
744 final TaxonName entity = new TaxonNameImpl();
745 entity.setTaxonomicLevel(taxonomicLevel);
746 entity.setReferenceTaxon(referenceTaxon);
747 return entity;
748 }
749
750 /**
751 * Constructs a new instance of {@link TaxonName}, taking all possible properties
752 * (except the identifier(s))as arguments.
753 * @param taxonNameNm String
754 * @param taxonNameCompleteNm String
755 * @param taxonNameIsNaming Boolean
756 * @param taxonNameCm String
757 * @param taxonNameUpperRk Integer
758 * @param taxonNameIsRefer Boolean
759 * @param taxonNameIsVirtual Boolean
760 * @param taxonNameObsol Boolean
761 * @param taxonNameTempor Boolean
762 * @param taxonNameCreationDt Date
763 * @param updateDt Timestamp
764 * @param taxonStartDt Date
765 * @param taxonEndDt Date
766 * @param citId Citation
767 * @param alternativeTaxons Collection<AlternativeTaxon>
768 * @param taxonNameHistories Collection<TaxonNameHistory>
769 * @param taxonNames Collection<TaxonName>
770 * @param parentTaxonName TaxonName
771 * @param taxonomicLevel TaxonomicLevel
772 * @param taxonGroupHistoricalRecords Collection<TaxonGroupHistoricalRecord>
773 * @param referenceTaxon ReferenceTaxon
774 * @param virtualComponents Collection<VirtualComponent>
775 * @return newInstance TaxonName
776 */
777 public static TaxonName newInstance(String taxonNameNm, String taxonNameCompleteNm, Boolean taxonNameIsNaming, String taxonNameCm, Integer taxonNameUpperRk, Boolean taxonNameIsRefer, Boolean taxonNameIsVirtual, Boolean taxonNameObsol, Boolean taxonNameTempor, Date taxonNameCreationDt, Timestamp updateDt, Date taxonStartDt, Date taxonEndDt, Citation citId, Collection<AlternativeTaxon> alternativeTaxons, Collection<TaxonNameHistory> taxonNameHistories, Collection<TaxonName> taxonNames, TaxonName parentTaxonName, TaxonomicLevel taxonomicLevel, Collection<TaxonGroupHistoricalRecord> taxonGroupHistoricalRecords, ReferenceTaxon referenceTaxon, Collection<VirtualComponent> virtualComponents)
778 {
779 final TaxonName entity = new TaxonNameImpl();
780 entity.setTaxonNameNm(taxonNameNm);
781 entity.setTaxonNameCompleteNm(taxonNameCompleteNm);
782 entity.setTaxonNameIsNaming(taxonNameIsNaming);
783 entity.setTaxonNameCm(taxonNameCm);
784 entity.setTaxonNameUpperRk(taxonNameUpperRk);
785 entity.setTaxonNameIsRefer(taxonNameIsRefer);
786 entity.setTaxonNameIsVirtual(taxonNameIsVirtual);
787 entity.setTaxonNameObsol(taxonNameObsol);
788 entity.setTaxonNameTempor(taxonNameTempor);
789 entity.setTaxonNameCreationDt(taxonNameCreationDt);
790 entity.setUpdateDt(updateDt);
791 entity.setTaxonStartDt(taxonStartDt);
792 entity.setTaxonEndDt(taxonEndDt);
793 entity.setCitId(citId);
794 entity.setAlternativeTaxons(alternativeTaxons);
795 entity.setTaxonNameHistories(taxonNameHistories);
796 entity.setTaxonNames(taxonNames);
797 entity.setParentTaxonName(parentTaxonName);
798 entity.setTaxonomicLevel(taxonomicLevel);
799 entity.setTaxonGroupHistoricalRecords(taxonGroupHistoricalRecords);
800 entity.setReferenceTaxon(referenceTaxon);
801 entity.setVirtualComponents(virtualComponents);
802 return entity;
803 }
804 }
805
806 /**
807 * @see Comparable#compareTo
808 */
809 public int compareTo(TaxonName o)
810 {
811 int cmp = 0;
812 if (this.getTaxonNameId() != null)
813 {
814 cmp = this.getTaxonNameId().compareTo(o.getTaxonNameId());
815 }
816 else
817 {
818 if (this.getTaxonNameNm() != null)
819 {
820 cmp = (cmp != 0 ? cmp : this.getTaxonNameNm().compareTo(o.getTaxonNameNm()));
821 }
822 if (this.getTaxonNameCompleteNm() != null)
823 {
824 cmp = (cmp != 0 ? cmp : this.getTaxonNameCompleteNm().compareTo(o.getTaxonNameCompleteNm()));
825 }
826 if (this.getTaxonNameIsNaming() != null)
827 {
828 cmp = (cmp != 0 ? cmp : this.getTaxonNameIsNaming().compareTo(o.getTaxonNameIsNaming()));
829 }
830 if (this.getTaxonNameCm() != null)
831 {
832 cmp = (cmp != 0 ? cmp : this.getTaxonNameCm().compareTo(o.getTaxonNameCm()));
833 }
834 if (this.getTaxonNameUpperRk() != null)
835 {
836 cmp = (cmp != 0 ? cmp : this.getTaxonNameUpperRk().compareTo(o.getTaxonNameUpperRk()));
837 }
838 if (this.getTaxonNameIsRefer() != null)
839 {
840 cmp = (cmp != 0 ? cmp : this.getTaxonNameIsRefer().compareTo(o.getTaxonNameIsRefer()));
841 }
842 if (this.getTaxonNameIsVirtual() != null)
843 {
844 cmp = (cmp != 0 ? cmp : this.getTaxonNameIsVirtual().compareTo(o.getTaxonNameIsVirtual()));
845 }
846 if (this.getTaxonNameObsol() != null)
847 {
848 cmp = (cmp != 0 ? cmp : this.getTaxonNameObsol().compareTo(o.getTaxonNameObsol()));
849 }
850 if (this.getTaxonNameTempor() != null)
851 {
852 cmp = (cmp != 0 ? cmp : this.getTaxonNameTempor().compareTo(o.getTaxonNameTempor()));
853 }
854 if (this.getTaxonNameCreationDt() != null)
855 {
856 cmp = (cmp != 0 ? cmp : this.getTaxonNameCreationDt().compareTo(o.getTaxonNameCreationDt()));
857 }
858 if (this.getUpdateDt() != null)
859 {
860 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
861 }
862 if (this.getTaxonStartDt() != null)
863 {
864 cmp = (cmp != 0 ? cmp : this.getTaxonStartDt().compareTo(o.getTaxonStartDt()));
865 }
866 if (this.getTaxonEndDt() != null)
867 {
868 cmp = (cmp != 0 ? cmp : this.getTaxonEndDt().compareTo(o.getTaxonEndDt()));
869 }
870 }
871 return cmp;
872 }
873 // HibernateEntity.vsl merge-point
874 // TaxonName.java merge-point
875 }