Project

General

Profile

Revision 55936b8f

ID55936b8fddad96905f226d0e4e0dcb0dca278b82
Parent 4f43cbbc
Child bef05816

Added by Andreas Müller about 2 years ago

fix #6943 add zoological in-authors to TaxonName

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/IZoologicalName.java
8 8
*/
9 9
package eu.etaxonomy.cdm.model.name;
10 10

  
11
import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
12

  
11 13
/**
12 14
 * TaxonName interface for animals.
13 15
 * <P>
......
66 68
     */
67 69
    public void setPublicationYear(Integer publicationYear);
68 70

  
71
    /**
72
     * @return the zoological in author of current combination
73
     * according to ICZN Recommendation 51E.
74
     * @see https://dev.e-taxonomy.eu/redmine/issues/6943
75
     */
76
    public TeamOrPersonBase<?> getInCombinationAuthorship();
77
    /**
78
     * @param the zoological in author of current combination
79
     * according to ICZN Recommendation 51E.
80
     * @see https://dev.e-taxonomy.eu/redmine/issues/6943
81
     */
82
    public void setInCombinationAuthorship(TeamOrPersonBase<?> inCombinationAuthorship);
83

  
84
    /**
85
     * @return the zoological in author of original combination
86
     * according to ICZN Recommendation 51E.
87
     * @see https://dev.e-taxonomy.eu/redmine/issues/6943
88
     */
89
    public TeamOrPersonBase<?> getInBasionymAuthorship();
90

  
91
    /**
92
     * @param the zoological in author of original combination
93
     * according to ICZN Recommendation 51E.
94
     * @see https://dev.e-taxonomy.eu/redmine/issues/6943
95
     */
96
    public void setInBasionymAuthorship(TeamOrPersonBase<?> inBasionymAuthorship);
97

  
98

  
99

  
69 100
}
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/TaxonName.java
24 24
import javax.persistence.FetchType;
25 25
import javax.persistence.Inheritance;
26 26
import javax.persistence.InheritanceType;
27
import javax.persistence.JoinColumn;
28 27
import javax.persistence.JoinTable;
29 28
import javax.persistence.ManyToMany;
30 29
import javax.persistence.ManyToOne;
......
169 168
    "breed",
170 169
    "publicationYear",
171 170
    "originalPublicationYear",
171
    "inCombinationAuthorship",
172
    "inBasionymAuthorship",
172 173

  
173 174
    "anamorphic",
174 175

  
......
414 415
    @Pattern(regexp = "[a-z\\u00E4\\u00EB\\u00EF\\u00F6\\u00FC\\-]+", groups=Level2.class, message = "{eu.etaxonomy.cdm.model.name.NonViralName.allowedCharactersForEpithet.message}")
415 416
    private String infraSpecificEpithet;
416 417

  
417
    @XmlElement(name = "CombinationAuthorship", type = TeamOrPersonBase.class)
418
    @XmlElement(name = "CombinationAuthorship")
418 419
    @XmlIDREF
419 420
    @XmlSchemaType(name = "IDREF")
420 421
    @ManyToOne(fetch = FetchType.LAZY)
421
//    @Target(TeamOrPersonBase.class)
422 422
    @Cascade({CascadeType.SAVE_UPDATE,CascadeType.MERGE})
423
    @JoinColumn(name="combinationAuthorship_id")
424 423
    @CacheUpdate("authorshipCache")
425 424
    @IndexedEmbedded
426 425
    private TeamOrPersonBase<?> combinationAuthorship;
427 426

  
428
    @XmlElement(name = "ExCombinationAuthorship", type = TeamOrPersonBase.class)
427
    @XmlElement(name = "ExCombinationAuthorship")
429 428
    @XmlIDREF
430 429
    @XmlSchemaType(name = "IDREF")
431 430
    @ManyToOne(fetch = FetchType.LAZY)
432
//    @Target(TeamOrPersonBase.class)
433 431
    @Cascade({CascadeType.SAVE_UPDATE,CascadeType.MERGE})
434
    @JoinColumn(name="exCombinationAuthorship_id")
435 432
    @CacheUpdate("authorshipCache")
436 433
    @IndexedEmbedded
437 434
    private TeamOrPersonBase<?> exCombinationAuthorship;
438 435

  
439
    @XmlElement(name = "BasionymAuthorship", type = TeamOrPersonBase.class)
436
    //#6943
437
    @XmlElement(name = "InCombinationAuthorship")
438
    @XmlIDREF
439
    @XmlSchemaType(name = "IDREF")
440
    @ManyToOne(fetch = FetchType.LAZY)
441
    @Cascade({CascadeType.SAVE_UPDATE,CascadeType.MERGE})
442
    @CacheUpdate("authorshipCache")
443
    @IndexedEmbedded
444
    private TeamOrPersonBase<?> inCombinationAuthorship;
445

  
446
    @XmlElement(name = "BasionymAuthorship")
440 447
    @XmlIDREF
441 448
    @XmlSchemaType(name = "IDREF")
442 449
    @ManyToOne(fetch = FetchType.LAZY)
443
//    @Target(TeamOrPersonBase.class)
444 450
    @Cascade({CascadeType.SAVE_UPDATE,CascadeType.MERGE})
445
    @JoinColumn(name="basionymAuthorship_id")
446 451
    @CacheUpdate("authorshipCache")
447 452
    @IndexedEmbedded
448 453
    private TeamOrPersonBase<?> basionymAuthorship;
449 454

  
450
    @XmlElement(name = "ExBasionymAuthorship", type = TeamOrPersonBase.class)
455
    @XmlElement(name = "ExBasionymAuthorship")
451 456
    @XmlIDREF
452 457
    @XmlSchemaType(name = "IDREF")
453 458
    @ManyToOne(fetch = FetchType.LAZY)
454
//    @Target(TeamOrPersonBase.class)
455 459
    @Cascade({CascadeType.SAVE_UPDATE,CascadeType.MERGE})
456
    @JoinColumn(name="exBasionymAuthorship_id")
457 460
    @CacheUpdate("authorshipCache")
458 461
    @IndexedEmbedded
459 462
    private TeamOrPersonBase<?> exBasionymAuthorship;
460 463

  
464
    //#6943
465
    @XmlElement(name = "InBasionymAuthorship")
466
    @XmlIDREF
467
    @XmlSchemaType(name = "IDREF")
468
    @ManyToOne(fetch = FetchType.LAZY)
469
    @Cascade({CascadeType.SAVE_UPDATE,CascadeType.MERGE})
470
    @CacheUpdate("authorshipCache")
471
    @IndexedEmbedded
472
    private TeamOrPersonBase<?> inBasionymAuthorship;
473

  
461 474
    @XmlElement(name = "AuthorshipCache")
462 475
    @Fields({
463 476
        @Field(name = "authorshipCache_tokenized"),
......
974 987
    public TeamOrPersonBase<?> getExCombinationAuthorship(){
975 988
        return this.exCombinationAuthorship;
976 989
    }
977

  
978 990
    /**
979 991
     * @see  #getExCombinationAuthorship()
980 992
     */
......
983 995
        this.exCombinationAuthorship = exCombinationAuthorship;
984 996
    }
985 997

  
998
    @Override
999
    public TeamOrPersonBase<?> getInCombinationAuthorship(){
1000
        return this.inCombinationAuthorship;
1001
    }
1002
    @Override
1003
    public void setInCombinationAuthorship(TeamOrPersonBase<?> inCombinationAuthorship) {
1004
        this.inCombinationAuthorship = inCombinationAuthorship;
1005
    }
1006

  
986 1007
    /**
987 1008
     * Returns the {@link eu.etaxonomy.cdm.model.agent.INomenclaturalAuthor author (team)} that published the original combination
988 1009
     * on which <i>this</i> non viral taxon name is nomenclaturally based. Such an
......
1036 1057
        this.exBasionymAuthorship = exBasionymAuthorship;
1037 1058
    }
1038 1059

  
1060
    @Override
1061
    public TeamOrPersonBase<?> getInBasionymAuthorship(){
1062
        return this.inBasionymAuthorship;
1063
    }
1064
    @Override
1065
    public void setInBasionymAuthorship(TeamOrPersonBase<?> inBasionymAuthorship) {
1066
        this.inBasionymAuthorship = inBasionymAuthorship;
1067
    }
1068

  
1039 1069
    /**
1040 1070
     * Returns the boolean value of the flag intended to protect (true)
1041 1071
     * or not (false) the {@link #getAuthorshipCache() authorshipCache} (complete authorship string)
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/update/v47_49/SchemaUpdater_47_49.java
170 170
        step = ColumnAdder.NewStringInstance(stepName, tableName, newColumnName, length, INCLUDE_AUDIT);
171 171
        stepList.add(step);
172 172

  
173
        //#6943 Add combination 'in'-author
174
        stepName = "Add combination 'in'-author";
175
        tableName = "TaxonName";
176
        newColumnName = "inCombinationAuthorship_id";
177
        String referencedTable = "AgentBase";
178
        step = ColumnAdder.NewIntegerInstance(stepName, tableName, newColumnName, INCLUDE_AUDIT, !NOT_NULL, referencedTable);
179
        stepList.add(step);
180

  
181
        //#6943 Add basionym 'in'-author
182
        stepName = "Add basionym 'in'-author";
183
        tableName = "TaxonName";
184
        newColumnName = "inBasionymAuthorship_id";
185
        referencedTable = "AgentBase";
186
        step = ColumnAdder.NewIntegerInstance(stepName, tableName, newColumnName, INCLUDE_AUDIT, !NOT_NULL, referencedTable);
187
        stepList.add(step);
173 188

  
174 189

  
175 190
        //7276  Make User.emailAddress a unique field
cdmlib-test/src/main/resources/dbscripts/001-cdm.h2.sql
4483 4483
    BASIONYMAUTHORSHIP_ID INTEGER,
4484 4484
    COMBINATIONAUTHORSHIP_ID INTEGER,
4485 4485
    EXBASIONYMAUTHORSHIP_ID INTEGER,
4486
    EXCOMBINATIONAUTHORSHIP_ID INTEGER
4486
    EXCOMBINATIONAUTHORSHIP_ID INTEGER,
4487
    INBASIONYMAUTHORSHIP_ID INTEGER,
4488
    INCOMBINATIONAUTHORSHIP_ID INTEGER
4487 4489
);
4488 4490
-- 0 +/- SELECT COUNT(*) FROM PUBLIC.TAXONNAME;
4489 4491
CREATE INDEX PUBLIC.TAXONNAMEBASETITLECACHEINDEX ON PUBLIC.TAXONNAME(TITLECACHE);
......
4537 4539
    ORIGINALPUBLICATIONYEAR INTEGER,
4538 4540
    PUBLICATIONYEAR INTEGER,
4539 4541
    NAMEAPPROBATION VARCHAR(255),
4540
    SUBGENUSAUTHORSHIP VARCHAR(255)
4542
    SUBGENUSAUTHORSHIP VARCHAR(255),
4543
    INBASIONYMAUTHORSHIP_ID INTEGER,
4544
    INCOMBINATIONAUTHORSHIP_ID INTEGER
4541 4545
);
4542 4546
-- 0 +/- SELECT COUNT(*) FROM PUBLIC.TAXONNAME_AUD;
4543 4547
CREATE CACHED TABLE PUBLIC.TAXONNAME_ANNOTATION(
cdmlib-test/src/main/resources/eu/etaxonomy/cdm/database/schema/dataset.dtd
3282 3282
    COMBINATIONAUTHORSHIP_ID CDATA #IMPLIED
3283 3283
    EXBASIONYMAUTHORSHIP_ID CDATA #IMPLIED
3284 3284
    EXCOMBINATIONAUTHORSHIP_ID CDATA #IMPLIED
3285
    INBASIONYMAUTHORSHIP_ID CDATA #IMPLIED
3286
    INCOMBINATIONAUTHORSHIP_ID CDATA #IMPLIED
3285 3287
>
3286 3288

  
3287 3289
<!ELEMENT TAXONNAME_ANNOTATION EMPTY>
......
3346 3348
    BREED CDATA #IMPLIED
3347 3349
    ORIGINALPUBLICATIONYEAR CDATA #IMPLIED
3348 3350
    PUBLICATIONYEAR CDATA #IMPLIED
3351
    INBASIONYMAUTHORSHIP_ID CDATA #IMPLIED
3352
    INCOMBINATIONAUTHORSHIP_ID CDATA #IMPLIED
3349 3353
>
3350 3354

  
3351 3355
<!ELEMENT TAXONNAME_EXTENSION EMPTY>

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)