Project

General

Profile

Revision d825b848

IDd825b848a24836b3e3cb9fc8ab3d47ea911d54a6
Parent 9414cfe9
Child b5c5e6fc

Added by Andreas Müller over 1 year ago

cleanup

View differences:

cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/cdmLight/CdmLightClassificationExport.java
1321 1321
            }else{
1322 1322
                csvLine[table.getIndex(CdmLightExportTable.HOMOTYPIC_GROUP_STRING)] = "";
1323 1323
            }
1324
            Set<TypeDesignationBase> typeDesigantionSet = group.getTypeDesignations();
1325
            List<TypeDesignationBase> designationList = new ArrayList<>();
1324
            Set<TypeDesignationBase<?>> typeDesigantionSet = group.getTypeDesignations();
1325
            List<TypeDesignationBase<?>> designationList = new ArrayList<>();
1326 1326
            designationList.addAll(typeDesigantionSet);
1327 1327
            Collections.sort(designationList, new TypeComparator());
1328 1328
            StringBuffer typeDesignationString = new StringBuffer();
1329
            List<TaggedText> list = new ArrayList<TaggedText>();
1329
            List<TaggedText> list = new ArrayList<>();
1330 1330
            if (!designationList.isEmpty()){
1331 1331
                TypeDesignationSetManager manager = new TypeDesignationSetManager(group);
1332 1332

  
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/csv/caryophyllales/out/CsvNameExport.java
588 588
        }
589 589
        nameRecord.put("fullName", name.getNameCache());
590 590
        nameRecord.put("fullTitleCache",  name.getFullTitleCache());
591
        Set<TypeDesignationBase> typeDesSet =  name.getTypeDesignations();
592
        Iterator<TypeDesignationBase> it = typeDesSet.iterator();
591
        Set<TypeDesignationBase<?>> typeDesSet =  name.getTypeDesignations();
592
        Iterator<TypeDesignationBase<?>> it = typeDesSet.iterator();
593 593
        String typeNameString = NOT_DESIGNATED;
594 594
        String statusString = null;
595 595
        if (it.hasNext()){
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/dwca/out/DwcaDataExportBase.java
95 95
        return result;
96 96
    }
97 97

  
98
    protected String getSources2(Set<DescriptionElementSource> set, DwcaTaxExportConfigurator config) {
98
    protected String getSources2(Set<DescriptionElementSource> sources, DwcaTaxExportConfigurator config) {
99 99
        String result = "";
100
        for(DescriptionElementSource source: set){
100
        for(DescriptionElementSource source: sources){
101 101
            if (StringUtils.isBlank(source.getIdInSource())){//idInSource indicates that this source is only data provenance, may be changed in future
102 102
                if (source.getCitation() != null){
103 103
                    String ref = source.getCitation().getTitleCache();
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/dwca/out/DwcaTypesExport.java
20 20
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
21 21
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeNotSupportedException;
22 22
import eu.etaxonomy.cdm.model.common.CdmBase;
23
import eu.etaxonomy.cdm.model.common.Language;
23 24
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
24 25
import eu.etaxonomy.cdm.model.description.IndividualsAssociation;
25 26
import eu.etaxonomy.cdm.model.description.TaxonDescription;
26 27
import eu.etaxonomy.cdm.model.name.INonViralName;
27 28
import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation;
28 29
import eu.etaxonomy.cdm.model.name.TaxonName;
30
import eu.etaxonomy.cdm.model.name.TextTypeDesignation;
29 31
import eu.etaxonomy.cdm.model.name.TypeDesignationBase;
30 32
import eu.etaxonomy.cdm.model.name.TypeDesignationStatusBase;
31 33
import eu.etaxonomy.cdm.model.occurrence.Collection;
......
91 93
            	for (DescriptionElementBase el : description.getElements()){
92 94
            		if (el.isInstanceOf(IndividualsAssociation.class)){
93 95
            			DwcaTypesRecord record = new DwcaTypesRecord(metaRecord, config);
94
            			IndividualsAssociation individualAssociation = CdmBase.deproxy(el,IndividualsAssociation.class);
96
            			IndividualsAssociation individualAssociation = CdmBase.deproxy(el, IndividualsAssociation.class);
95 97
            			if (! state.recordExistsUuid(individualAssociation)
96 98
            			        && handleSpecimen(state, record, individualAssociation, null, taxon, config)){
97 99
            			    PrintWriter writer = createPrintWriter(state, file);
......
131 133
	 * @throws UnsupportedEncodingException
132 134
	 * @throws FileNotFoundException
133 135
	 */
134
	private Set<TypeDesignationBase> handleTypeName(DwcaTaxExportState state,
136
	private Set<TypeDesignationBase<?>> handleTypeName(DwcaTaxExportState state,
135 137
	        DwcaTaxExportFile file, TaxonBase<?> taxonBase,
136 138
	        INonViralName nvn, DwcaMetaDataRecord metaRecord)
137 139
	        throws FileNotFoundException, UnsupportedEncodingException, IOException {
140

  
138 141
	    DwcaTaxExportConfigurator config = state.getConfig();
139
		Set<TypeDesignationBase> designations = nvn.getTypeDesignations();
142
		Set<TypeDesignationBase<?>> designations = nvn.getTypeDesignations();
140 143
		for (TypeDesignationBase<?> designation:designations){
141 144
			DwcaTypesRecord record = new DwcaTypesRecord(metaRecord, config);
142 145
			if (! state.recordExistsUuid(designation)
143
			        && handleSpecimen(state, record, null, designation, taxonBase, config)){
146
			        && handleType(state, record, designation, taxonBase, config)){
144 147
			    PrintWriter writer = createPrintWriter(state, file);
145 148
                record.write(state, writer);
146 149
				state.addExistingRecordUuid(designation);
......
149 152
		return designations;
150 153
	}
151 154

  
155
   private boolean handleType(DwcaTaxExportState state, DwcaTypesRecord record,
156
           TypeDesignationBase<?> designation, TaxonBase<?> taxonBase,
157
           DwcaTaxExportConfigurator config) {
158
       designation = CdmBase.deproxy(designation);
159
       if (designation instanceof TextTypeDesignation){
160
           return handleTextualType(state, record, (TextTypeDesignation)designation, taxonBase, config);
161
       }else if (designation instanceof TypeDesignationBase){
162
           return handleSpecimen(state, record, null, designation, taxonBase, config);
163
       }else{
164
           throw new RuntimeException ("TypeDesignation type not handled");
165
       }
166
   }
167

  
168
	private boolean handleTextualType(DwcaTaxExportState state, DwcaTypesRecord record,
169
	            TextTypeDesignation designation, TaxonBase<?> taxonBase,
170
	            DwcaTaxExportConfigurator config) {
171

  
172
	        if (designation == null){
173
	            return false;
174
	        }
175

  
176
	        record.setId(taxonBase.getId());
177
	        record.setUuid(taxonBase.getUuid());
178
	        record.setBibliographicCitation(designation.getPreferredText(Language.DEFAULT()));
179

  
180
	        //TODO ???
181

  
182
//	        record.setSource(getSources3(facade.innerDerivedUnit(), config));
183
//	        record.setDescriptionSource(source2);
184

  
185
	        //TODO missing
186
	        record.setVerbatimLabel(designation.getPreferredText(Language.DEFAULT()));
187

  
188
	        return true;
189
	    }
190

  
191
	private boolean handleSpecimen(DwcaTaxExportState state, DwcaTypesRecord record, IndividualsAssociation individualsAssociation,
192
	        TypeDesignationBase<?> designation, TaxonBase<?> taxonBase, DwcaTaxExportConfigurator config) {
152 193

  
153
	private boolean handleSpecimen(DwcaTaxExportState state, DwcaTypesRecord record, IndividualsAssociation individualsAssociation, TypeDesignationBase<?> designation, TaxonBase<?> taxonBase, DwcaTaxExportConfigurator config) {
154
		TypeDesignationStatusBase<?> status = null;
194
	    TypeDesignationStatusBase<?> status = null;
155 195
		DerivedUnitFacade facade = null;
156 196
		if (individualsAssociation != null){
157 197
			facade = getFacadeFromAssociation(state, individualsAssociation);
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/jaxb/DataSet.java
231 231
    	@XmlElement(name = "NameTypeDesignation", namespace = "http://etaxonomy.eu/cdm/model/name/1.0", type = NameTypeDesignation.class),
232 232
    	@XmlElement(name = "SpecimenTypeDesignation", namespace = "http://etaxonomy.eu/cdm/model/name/1.0", type = SpecimenTypeDesignation.class)
233 233
    })
234
    protected List<TypeDesignationBase> typeDesignations = new ArrayList<>();
234
    protected List<TypeDesignationBase<?>> typeDesignations = new ArrayList<>();
235 235

  
236 236
    @XmlElementWrapper(name = "TaxonomicNames")
237 237
    @XmlElements({
......
702 702
     *     {@link List<TypeDesignationBase> }
703 703
     *
704 704
     */
705
    public List<TypeDesignationBase> getTypeDesignations() {
705
    public List<TypeDesignationBase<?>> getTypeDesignations() {
706 706
    	return typeDesignations;
707 707
    }
708 708

  
......
714 714
     *     {@link List<TypeDesignationBase> }
715 715
     *
716 716
     */
717
	public void addTypeDesignations(List<TypeDesignationBase> typeDesignations) {
717
	public void addTypeDesignations(List<TypeDesignationBase<?>> typeDesignations) {
718 718
		this.typeDesignations.addAll(typeDesignations);
719 719
	}
720 720

  
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/jaxb/JaxbImport.java
115 115
		List<Reference> references;
116 116
		List<TaxonName> taxonomicNames;
117 117
		List<DescriptionBase> descriptions;
118
		List<TypeDesignationBase> typeDesignations;
118
		List<TypeDesignationBase<?>> typeDesignations;
119 119
		List<SpecimenOrObservationBase> occurrences;
120 120
		List<FeatureTree> featureTrees;
121 121
		List<FeatureNode> featureNodes;
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/sdd/out/SDDDataSet.java
124 124

  
125 125
    @XmlElementWrapper(name = "AgentData")
126 126
    @XmlElements({
127
    @XmlElement(name = "Address", namespace = "http://etaxonomy.eu/cdm/model/agent/1.0", type = Address.class),
128
    @XmlElement(name = "Contact", namespace = "http://etaxonomy.eu/cdm/model/agent/1.0", type = Contact.class),
129
    @XmlElement(name = "InstitutionalMembership", namespace = "http://etaxonomy.eu/cdm/model/agent/1.0", type = InstitutionalMembership.class)
127
        @XmlElement(name = "Address", namespace = "http://etaxonomy.eu/cdm/model/agent/1.0", type = Address.class),
128
        @XmlElement(name = "Contact", namespace = "http://etaxonomy.eu/cdm/model/agent/1.0", type = Contact.class),
129
        @XmlElement(name = "InstitutionalMembership", namespace = "http://etaxonomy.eu/cdm/model/agent/1.0", type = InstitutionalMembership.class)
130 130
    })
131 131
    protected List<VersionableEntity> agentData;
132 132

  
133 133
    @XmlElementWrapper(name = "FeatureData")
134
    @XmlElements({
135
    @XmlElement(name = "FeatureNode", namespace = "http://etaxonomy.eu/cdm/model/description/1.0", type = FeatureNode.class),
136
    @XmlElement(name = "FeatureTree", namespace = "http://etaxonomy.eu/cdm/model/description/1.0", type = FeatureTree.class)
134
        @XmlElements({
135
        @XmlElement(name = "FeatureNode", namespace = "http://etaxonomy.eu/cdm/model/description/1.0", type = FeatureNode.class),
136
        @XmlElement(name = "FeatureTree", namespace = "http://etaxonomy.eu/cdm/model/description/1.0", type = FeatureTree.class)
137 137
    })
138 138
//    protected List<VersionableEntity> featureData;
139 139
    protected List<VersionableEntity> featureData;
140 140

  
141 141
    @XmlElementWrapper(name = "LanguageData")
142
    @XmlElements({
143
    @XmlElement(name = "Representation", namespace = "http://etaxonomy.eu/cdm/model/common/1.0", type = Representation.class),
144
    @XmlElement(name = "LanguageString", namespace = "http://etaxonomy.eu/cdm/model/common/1.0", type = LanguageString.class)
142
        @XmlElements({
143
        @XmlElement(name = "Representation", namespace = "http://etaxonomy.eu/cdm/model/common/1.0", type = Representation.class),
144
        @XmlElement(name = "LanguageString", namespace = "http://etaxonomy.eu/cdm/model/common/1.0", type = LanguageString.class)
145 145
    })
146 146
    protected List<LanguageStringBase> languageData;
147 147

  
cdmlib-io/src/test/java/eu/etaxonomy/cdm/test/integration/TestCdmDbComparator.java
451 451
//		List<TaxonName> taxonNames = appCtr.getNameService().getAllNames(MAX_ROWS, 0);
452 452
		//List<TaxonRelationship> taxonRelationships = appCtr.getTaxonService().getAllTaxonRelationships(MAX_ROWS, 0);
453 453
		List<TermVocabulary> termVocabularies = appCtr.getVocabularyService().list(null,MAX_ROWS, 0,null,null);
454
		List<TypeDesignationBase> typeDesignationBases = appCtr.getNameService().getAllTypeDesignations(MAX_ROWS, 0);
454
		List<TypeDesignationBase<?>> typeDesignationBases = appCtr.getNameService().getAllTypeDesignations(MAX_ROWS, 0);
455 455

  
456 456
		return tables;
457 457
	}
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/ReferencedEntityBase.java
48 48
	@SuppressWarnings("unused")
49 49
	private static final Logger logger = Logger.getLogger(ReferencedEntityBase.class);
50 50

  
51
	//Details of the reference. These are mostly (implicitly) pages but can also be tables or any other element of a
52
	//publication. {if the citationMicroReference exists then there must be also a reference}
53
    @XmlElement(name = "Citation")
51
	@XmlElement(name = "Citation")
54 52
    @XmlIDREF
55 53
    @XmlSchemaType(name = "IDREF")
56 54
    @ManyToOne(fetch = FetchType.LAZY)
57 55
    @Cascade({CascadeType.SAVE_UPDATE,CascadeType.MERGE})
58 56
	private Reference citation;
59 57

  
58
	//Details of the reference. These are mostly (implicitly) pages but can also be tables or any other element of a
59
    //publication. {if the citationMicroReference exists then there must be also a reference}
60 60
    @XmlElement(name = "CitationMicroReference")
61 61
	private String citationMicroReference;
62 62

  
......
74 74

  
75 75
	public ReferencedEntityBase(Reference citation, String citationMicroReference,
76 76
			String originalNameString) {
77
		super();
78 77
		this.citationMicroReference = citationMicroReference;
79 78
		this.originalNameString = originalNameString;
80 79
		this.citation = citation;
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/DescriptionElementBase.java
96 96
@Entity
97 97
@Audited
98 98
@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
99
public abstract class DescriptionElementBase extends AnnotatableEntity implements ISourceable<DescriptionElementSource>, IModifiable, IMultiLanguageTextHolder{
99
public abstract class DescriptionElementBase extends AnnotatableEntity
100
        implements ISourceable<DescriptionElementSource>, IModifiable, IMultiLanguageTextHolder{
100 101
    private static final long serialVersionUID = 5000910777835755905L;
101 102
    @SuppressWarnings("unused")
102 103
    private static final Logger logger = Logger.getLogger(DescriptionElementBase.class);
......
392 393
        return this.modifyingText.remove(language);
393 394
    }
394 395

  
395
    /* (non-Javadoc)
396
     * @see eu.etaxonomy.cdm.model.common.ISourceable#getSources()
397
     */
398 396
    @Override
399 397
    public Set<DescriptionElementSource> getSources() {
400 398
        return this.sources;
......
500 498
    }
501 499

  
502 500

  
501
    /**
502
     * Is this description item of a class type which is considere to
503
     * represent character data? These classes are {@link QuantitativeData}
504
     * and {@link CategoricalData}.
505
     * To be overriden by these classes.
506
     */
507
    @Transient
508
    @XmlTransient
509
    public boolean isCharacterData() {
510
        return false;
511
    }
512

  
513

  
503 514

  
504 515
//************************** CLONE **********************************************************/
505 516

  
......
555 566
        return result;
556 567
    }
557 568

  
558
    /**
559
     * Is this description item of a class type which is considere to
560
     * represent character data? These classes are {@link QuantitativeData}
561
     * and {@link CategoricalData}.
562
     * To be overriden by these classes.
563
     */
564
    @Transient
565
    @XmlTransient
566
    public boolean isCharacterData() {
567
        return false;
568
    }
569

  
570

  
571 569
}
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/HomotypicalGroup.java
223 223
	 * @see	TaxonName#getTypeDesignations()
224 224
	 */
225 225
	@Transient
226
	public Set<TypeDesignationBase> getTypeDesignations(){
227
		Set<TypeDesignationBase> result = new HashSet<TypeDesignationBase>();
226
	public Set<TypeDesignationBase<?>> getTypeDesignations(){
227
		Set<TypeDesignationBase<?>> result = new HashSet<>();
228 228
		for (TaxonName taxonName : typifiedNames){
229 229
			result.addAll(taxonName.getTypeDesignations());
230 230
		}
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/ITaxonNameBase.java
421 421
     * @see     NameTypeDesignation
422 422
     * @see     SpecimenTypeDesignation
423 423
     */
424
    public Set<TypeDesignationBase> getTypeDesignations();
424
    public Set<TypeDesignationBase<?>> getTypeDesignations();
425 425

  
426 426
    /**
427 427
     * Removes one element from the set of {@link TypeDesignationBase type designations} assigned to
......
429 429
     *
430 430
     * @param  typeDesignation  the type designation which should be deleted
431 431
     */
432
    public void removeTypeDesignation(TypeDesignationBase typeDesignation);
432
    public void removeTypeDesignation(TypeDesignationBase<? >typeDesignation);
433 433

  
434 434
    /**
435 435
     * Returns the set of {@link SpecimenTypeDesignation specimen type designations} assigned
......
539 539
     * @param addToAllNames             the boolean indicating whether the type designation should be
540 540
     *                                  added to all taxon names of the homotypical group the typified
541 541
     *                                  taxon name belongs to
542
     * @return                          true if the operation was succesful
542
     * @return                          true if the operation was successful
543 543
     *
544 544
     * @throws IllegalArgumentException if the type designation already has typified names, an {@link IllegalArgumentException exception}
545 545
     *                                  is thrown. We do this to prevent a type designation to be used for multiple taxon names.
546 546
     *
547 547
     */
548
    public boolean addTypeDesignation(TypeDesignationBase typeDesignation, boolean addToAllNames);
548
    public boolean addTypeDesignation(TypeDesignationBase<?> typeDesignation, boolean addToAllNames);
549 549

  
550 550
    /**
551 551
     * Returns the {@link HomotypicalGroup homotypical group} to which
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/ITypeDesignation.java
18 18
public interface ITypeDesignation {
19 19

  
20 20

  
21
	/**
22
	 * Returns the boolean value indicating whether <i>this</i> type
23
	 * designation has a "lectotype" status (true) or not (false).<BR>
24
	 * A lectotype is a type designated as the
25
	 * nomenclatural type, when no holotype was indicated at the time of
26
	 * publication of the "type-bringing" {@link TaxonName taxon name}, when the
27
	 * holotype is found to belong to more than one taxon name,
28
	 * or as long as it is missing.
29
	 *
30
	 * @see  SpecimenTypeDesignationStatus#isLectotype()
31
	 * @see  SpecimenTypeDesignationStatus#HOLOTYPE()
32
	 * @see  NameTypeDesignationStatus#isLectotype()
33
	 */
34

  
35
	public boolean isLectoType();
21
    /**
22
     * Returns the boolean value indicating whether <i>this</i> type
23
     * designation has a "lectotype" status (true) or not (false).<BR>
24
     * A lectotype is a type designated as the
25
     * nomenclatural type, when no holotype was indicated at the time of
26
     * publication of the "type-bringing" {@link TaxonName taxon name}, when the
27
     * holotype is found to belong to more than one taxon name,
28
     * or as long as it is missing.
29
     *
30
     * @see  SpecimenTypeDesignationStatus#isLectotype()
31
     * @see  SpecimenTypeDesignationStatus#HOLOTYPE()
32
     * @see  NameTypeDesignationStatus#isLectotype()
33
     */
34

  
35
    public boolean isLectoType();
36 36

  
37 37
//	/**
38 38
//	 * Returns the {@link HomotypicalGroup homotypical group} that is typified
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/NameTypeDesignationStatus.java
92 92

  
93 93
//************************** METHODS ********************************
94 94

  
95
	/* (non-Javadoc)
96
	 * @see eu.etaxonomy.cdm.model.common.DefinedTermBase#resetTerms()
97
	 */
98 95
	@Override
99 96
	public void resetTerms(){
100 97
		termMap = null;
......
229 226
			return false;
230 227
		}
231 228
	}
229

  
232 230
}
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/SpecimenTypeDesignation.java
70 70
	@Cascade({CascadeType.SAVE_UPDATE,CascadeType.MERGE})
71 71
	private DerivedUnit typeSpecimen;
72 72

  
73

  
74
    public static SpecimenTypeDesignation NewInstance() {
75
        return new SpecimenTypeDesignation();
76
    }
77

  
73 78
//	/**
74 79
//	 * Creates a new specimen type designation instance
75 80
//	 * (including its {@link reference.Reference reference source} and eventually
......
93 98
//		return specTypeDesig;
94 99
//	}
95 100

  
96

  
97
	// ************* CONSTRUCTORS *************/
101
// ************* CONSTRUCTORS *************/
98 102
	/**
99 103
	 * Class constructor: creates a new empty specimen type designation.
100 104
	 *
......
104 108
	protected SpecimenTypeDesignation(){
105 109
	}
106 110

  
107
	public static SpecimenTypeDesignation NewInstance() {
108
		return new SpecimenTypeDesignation();
109
	}
110 111

  
111 112
	/**
112 113
	 * Class constructor: creates a new specimen type designation instance
......
137 138
		this.setTypeStatus(status);
138 139
	}
139 140

  
140
	//********* METHODS **************************************/
141

  
141
//********* METHODS **************************************/
142 142

  
143
	/* (non-Javadoc)
144
	 * @see eu.etaxonomy.cdm.model.name.TypeDesignationBase#removeType()
145
	 */
146 143
	@Override
147 144
	public void removeType() {
148 145
		this.setTypeSpecimen(null);
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/TaxonName.java
268 268
    )
269 269
    @Cascade({CascadeType.SAVE_UPDATE,CascadeType.MERGE})
270 270
    @NotNull
271
    private Set<TypeDesignationBase> typeDesignations = new HashSet<>();
271
    private Set<TypeDesignationBase<?>> typeDesignations = new HashSet<>();
272 272

  
273 273
    @XmlElement(name = "HomotypicalGroup")
274 274
    @XmlIDREF
......
2441 2441
     * @see     SpecimenTypeDesignation
2442 2442
     */
2443 2443
    @Override
2444
    public Set<TypeDesignationBase> getTypeDesignations() {
2444
    public Set<TypeDesignationBase<?>> getTypeDesignations() {
2445 2445
        if(typeDesignations == null) {
2446 2446
            this.typeDesignations = new HashSet<>();
2447 2447
        }
......
2456 2456
     */
2457 2457
    @Override
2458 2458
    @SuppressWarnings("deprecation")
2459
    public void removeTypeDesignation(TypeDesignationBase typeDesignation) {
2459
    public void removeTypeDesignation(TypeDesignationBase<?> typeDesignation) {
2460 2460
        this.typeDesignations.remove(typeDesignation);
2461 2461
        typeDesignation.removeTypifiedName(this);
2462 2462
    }
......
2495 2495
    @Override
2496 2496
    @Transient
2497 2497
    public Set<NameTypeDesignation> getNameTypeDesignations() {
2498
        Set<NameTypeDesignation> result = new HashSet<NameTypeDesignation>();
2499
        for (TypeDesignationBase typeDesignation : this.typeDesignations){
2500
            if (typeDesignation instanceof NameTypeDesignation){
2501
                result.add((NameTypeDesignation)typeDesignation);
2498
        Set<NameTypeDesignation> result = new HashSet<>();
2499
        for (TypeDesignationBase<?> typeDesignation : this.typeDesignations){
2500
            if (typeDesignation.isInstanceOf(NameTypeDesignation.class)){
2501
                result.add(CdmBase.deproxy(typeDesignation, NameTypeDesignation.class));
2502 2502
            }
2503 2503
        }
2504 2504
        return result;
......
2577 2577
    @Override
2578 2578
    @Transient
2579 2579
    public Set<SpecimenTypeDesignation> getSpecimenTypeDesignations() {
2580
        Set<SpecimenTypeDesignation> result = new HashSet<SpecimenTypeDesignation>();
2581
        for (TypeDesignationBase typeDesignation : this.typeDesignations){
2582
            if (typeDesignation instanceof SpecimenTypeDesignation){
2583
                result.add((SpecimenTypeDesignation)typeDesignation);
2580
        Set<SpecimenTypeDesignation> result = new HashSet<>();
2581
        for (TypeDesignationBase<?> typeDesignation : this.typeDesignations){
2582
            if (typeDesignation.isInstanceOf(SpecimenTypeDesignation.class)){
2583
                result.add(CdmBase.deproxy(typeDesignation, SpecimenTypeDesignation.class));
2584 2584
            }
2585 2585
        }
2586 2586
        return result;
......
2638 2638
     *
2639 2639
     */
2640 2640
    @Override
2641
    public boolean addTypeDesignation(TypeDesignationBase typeDesignation, boolean addToAllNames){
2641
    public boolean addTypeDesignation(TypeDesignationBase<?> typeDesignation, boolean addToAllNames){
2642 2642
        //currently typeDesignations are not persisted with the homotypical group
2643 2643
        //so explicit adding to the homotypical group is not necessary.
2644 2644
        if (typeDesignation != null){
......
2661 2661
     * Throws an Exception this type designation already has typified names from another homotypical group.
2662 2662
     * @param typeDesignation
2663 2663
     */
2664
    private void checkHomotypicalGroup(TypeDesignationBase typeDesignation) {
2664
    private void checkHomotypicalGroup(TypeDesignationBase<?> typeDesignation) {
2665 2665
        if(typeDesignation.getTypifiedNames().size() > 0){
2666 2666
            Set<HomotypicalGroup> groups = new HashSet<>();
2667 2667
            Set<TaxonName> names = typeDesignation.getTypifiedNames();
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/TypeComparator.java
10 10

  
11 11
import java.util.Comparator;
12 12

  
13
import eu.etaxonomy.cdm.model.common.CdmBase;
14

  
13 15
/**
14 16
 * @author k.luther
15 17
 * @since 21.03.2017
16 18
 *
17 19
 */
18
public class TypeComparator implements Comparator<TypeDesignationBase> {
20
public class TypeComparator implements Comparator<TypeDesignationBase<?>> {
19 21

  
20 22
    /**
21 23
     * {@inheritDoc}
22 24
     */
23 25
    @Override
24
    public int compare(TypeDesignationBase o1, TypeDesignationBase o2) {
26
    public int compare(TypeDesignationBase<?> o1, TypeDesignationBase<?> o2) {
25 27
        /*
26 28
         * Sortierung:
27 29
        1.  Status der Typen: a) holo, lecto, neo, syn, b) epi, paralecto, c) para (wenn überhaupt) – die jeweiligen iso immer direct mit dazu
......
44 46
            return 1;
45 47
        }
46 48

  
47
        TypeDesignationStatusBase status1 = o1.getTypeStatus();
48
        TypeDesignationStatusBase status2 = o2.getTypeStatus();
49
        TypeDesignationStatusBase<?> status1 = getStatus(o1);
50
        TypeDesignationStatusBase<?> status2 = getStatus(o2);
49 51

  
50 52
        result = compareStatus(status1, status2);
51 53
        if (result != 0){
......
68 70
    }
69 71

  
70 72
    /**
73
     * @param o1
74
     * @return
75
     */
76
    private TypeDesignationStatusBase<?> getStatus(TypeDesignationBase<?> td) {
77
        if (td.isInstanceOf(TypeDesignationBase.class)){
78
            return CdmBase.deproxy(td, TypeDesignationBase.class).getTypeStatus();
79
        }else{
80
            return null;
81
        }
82
    }
83

  
84
    /**
71 85
     * @param status1
72 86
     * @param status2
73 87
     * @return
......
187 201
             return false;
188 202
         }
189 203
    }
190

  
191

  
192 204
}
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/name/TypeDesignationDaoHibernateImpl.java
35 35

  
36 36
	//TODO limit start
37 37
	@Override
38
    public List<TypeDesignationBase> getAllTypeDesignations(Integer limit, Integer start) {
38
    public List<TypeDesignationBase<?>> getAllTypeDesignations(Integer limit, Integer start) {
39 39
		Criteria crit = getSession().createCriteria(TypeDesignationBase.class);
40 40
		if(limit != null){
41 41
		    crit.setMaxResults(limit);
......
43 43
		if(start != null){
44 44
		    crit.setFirstResult(start);
45 45
		}
46
		List<TypeDesignationBase> results = crit.list();
46
		@SuppressWarnings("unchecked")
47
        List<TypeDesignationBase<?>> results = crit.list();
47 48
		return results;
48 49
	}
49 50

  
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/name/ITypeDesignationDao.java
1 1
/**
2 2
* Copyright (C) 2007 EDIT
3
* European Distributed Institute of Taxonomy 
3
* European Distributed Institute of Taxonomy
4 4
* http://www.e-taxonomy.eu
5
* 
5
*
6 6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7 7
* See LICENSE.TXT at the top of this package for the full license terms.
8 8
*/
cdmlib-persistence/src/test/java/eu/etaxonomy/cdm/persistence/dao/hibernate/name/TypeDesignationDaoHibernateImplTest.java
74 74
	@Test
75 75
	@DataSet
76 76
	public void testGetAllTypeDesignations() {
77
		List<TypeDesignationBase> typeDesignations = typeDesignationDao.getAllTypeDesignations(100, 0);
77
		List<TypeDesignationBase<?>> typeDesignations = typeDesignationDao.getAllTypeDesignations(100, 0);
78 78
		assertEquals(2, typeDesignations.size());
79 79
		SpecimenTypeDesignation specTypeDesig = null;
80
		for (TypeDesignationBase typeDesignation : typeDesignations) {
81
			if (typeDesignation.isInstanceOf(NameTypeDesignation.class)) {
82
				assertTrue(typeDesignation.getTypeStatus().isInstanceOf(NameTypeDesignationStatus.class));
83
			} else if (typeDesignation.isInstanceOf(SpecimenTypeDesignation.class)) {
80
		for (TypeDesignationBase<?> typeDesignation : typeDesignations) {
81
		    typeDesignation= CdmBase.deproxy(typeDesignation);
82
			if (typeDesignation instanceof NameTypeDesignation) {
83
				assertTrue(((NameTypeDesignation)typeDesignation).getTypeStatus().isInstanceOf(NameTypeDesignationStatus.class));
84
			} else if (typeDesignation instanceof SpecimenTypeDesignation) {
84 85
				Assert.assertNull("There should be only 1 specimen type designation but this is already the second", specTypeDesig);
85
				TypeDesignationStatusBase typeDesignationStatus = typeDesignation.getTypeStatus();
86
				TypeDesignationStatusBase<?> typeDesignationStatus = ((SpecimenTypeDesignation)typeDesignation).getTypeStatus();
86 87
				assertTrue(typeDesignationStatus.isInstanceOf(SpecimenTypeDesignationStatus.class));
87 88
				specTypeDesig = CdmBase.deproxy(typeDesignation,SpecimenTypeDesignation.class);
88 89
			}
89 90
		}
90
		Set<TaxonName> names = specTypeDesig.getTypifiedNames();
91
		@SuppressWarnings("null")
92
        Set<TaxonName> names = specTypeDesig.getTypifiedNames();
91 93
		Assert.assertEquals("There should be exactly 1 typified name for the the specimen type designation", 1, names.size());
92 94
		TaxonName singleName = names.iterator().next();
93 95
		Assert.assertEquals("", UUID.fromString("61b1dcae-8aa6-478a-bcd6-080cf0eb6ad7"), singleName.getUuid());
......
100 102
	@DataSet
101 103
	@ExpectedDataSet  //not yet necessary with current test
102 104
	public void testSaveTypeDesignations() {
103
		List<TypeDesignationBase> typeDesignations = typeDesignationDao.getAllTypeDesignations(100, 0);
105
		List<TypeDesignationBase<?>> typeDesignations = typeDesignationDao.getAllTypeDesignations(100, 0);
104 106
		assertEquals(typeDesignations.size(), 2);
105 107
		SpecimenTypeDesignation specTypeDesig = null;
106
		for (TypeDesignationBase typeDesignation : typeDesignations) {
108
		for (TypeDesignationBase<?> typeDesignation : typeDesignations) {
107 109
			if (typeDesignation.isInstanceOf(SpecimenTypeDesignation.class)) {
108 110
				specTypeDesig = CdmBase.deproxy(typeDesignation,SpecimenTypeDesignation.class);
109 111
			}
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/TypeDesignationController.java
69 69

  
70 70
        logger.info("doGetMediaUris() - " + requestPathAndQuery(request));
71 71
        ArrayList<MediaDTO> dtos = new ArrayList<>();
72
        TypeDesignationBase td = service.loadTypeDesignation(uuid, Arrays.asList("typeSpecimen.mediaSpecimen.representations.mediaRepresentationParts"));
72
        TypeDesignationBase<?> td = service.loadTypeDesignation(uuid, Arrays.asList("typeSpecimen.mediaSpecimen.representations.mediaRepresentationParts"));
73 73
        if(td instanceof SpecimenTypeDesignation){
74 74
            SpecimenTypeDesignation std = (SpecimenTypeDesignation)td;
75 75
            DerivedUnit du = HibernateProxyHelper.deproxy(std.getTypeSpecimen(), DerivedUnit.class);
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/INameService.java
40 40
import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignationStatus;
41 41
import eu.etaxonomy.cdm.model.name.TaxonName;
42 42
import eu.etaxonomy.cdm.model.name.TypeDesignationBase;
43
import eu.etaxonomy.cdm.persistence.dao.initializer.IBeanInitializer;
43 44
import eu.etaxonomy.cdm.persistence.dto.TaxonNameParts;
44 45
import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
45 46
import eu.etaxonomy.cdm.persistence.query.MatchMode;
46 47
import eu.etaxonomy.cdm.persistence.query.OrderHint;
47 48
import eu.etaxonomy.cdm.strategy.cache.TaggedText;
49
import eu.etaxonomy.cdm.strategy.parser.NonViralNameParserImpl;
48 50

  
49 51
public interface INameService
50 52
        extends IIdentifiableEntityService<TaxonName> {
......
69 71
	 * @param name
70 72
	 * @return
71 73
	 */
72
	public DeleteResult deleteTypeDesignation(TaxonName name, TypeDesignationBase typeDesignation);
74
	public DeleteResult deleteTypeDesignation(TaxonName name, TypeDesignationBase<?> typeDesignation);
73 75

  
74 76
	/**
75 77
	 * Removes the given type designation from the given taxon name and deletes it from
......
89 91
	 * @param typeDesignationCollection
90 92
	 * @return
91 93
	 */
92
	public Map<UUID, TypeDesignationBase> saveTypeDesignationAll(Collection<TypeDesignationBase> typeDesignationCollection);
94
	public Map<UUID, TypeDesignationBase<?>> saveTypeDesignationAll(Collection<TypeDesignationBase<?>> typeDesignationCollection);
93 95

  
94 96
	public Map<UUID, ReferencedEntityBase> saveReferencedEntitiesAll(Collection<ReferencedEntityBase> referencedEntityCollection);
95 97

  
......
114 116
	 * @param start
115 117
	 * @return
116 118
	 */
117
	public List<TypeDesignationBase> getAllTypeDesignations(int limit, int start);
119
	public List<TypeDesignationBase<?>> getAllTypeDesignations(int limit, int start);
118 120

  
119
    public TypeDesignationBase loadTypeDesignation(int id, List<String> propertyPaths);
121
    public TypeDesignationBase<?> loadTypeDesignation(int id, List<String> propertyPaths);
120 122

  
121
    public TypeDesignationBase loadTypeDesignation(UUID uuid, List<String> propertyPaths);
123
    public TypeDesignationBase<?> loadTypeDesignation(UUID uuid, List<String> propertyPaths);
122 124

  
123 125
	/**
124 126
	 * Returns all NonViralNames with a name cache that matches the given string
......
199 201
	 * @param propertyPaths
200 202
	 * @param maxNoOfResults
201 203
	 * @return
202
	 * @throws CorruptIndexException
203 204
	 * @throws IOException
204
	 * @throws ParseException
205
	 * @throws LuceneParseException
205 206
	 */
206 207
	public List<SearchResult<TaxonName>> findByNameFuzzySearch(
207 208
            String name,
......
224 225
	 * @param highlightFragments
225 226
	 * @param maxNoOfResults
226 227
	 * @return
227
	 * @throws CorruptIndexException
228 228
	 * @throws IOException
229
	 * @throws ParseException
229
	 * @throws LuceneParseException
230 230
	 */
231 231
    public List<DocumentSearchResult> findByNameFuzzySearch(
232 232
            String name,
......
245 245
	 * @param highlightFragments
246 246
	 * @param maxNoOfResults
247 247
	 * @return
248
	 * @throws CorruptIndexException
249 248
	 * @throws IOException
250
	 * @throws ParseException
249
	 * @throws LuceneParseException
251 250
	 */
252 251
    public List<DocumentSearchResult> findByFuzzyNameCacheSearch(
253 252
            String name,
......
269 268
	 * @param highlightFragments
270 269
	 * @param maxNoOfResults
271 270
	 * @return
272
	 * @throws CorruptIndexException
273 271
	 * @throws IOException
274
	 * @throws ParseException
272
	 * @throws LuceneParseException
275 273
	 */
276 274

  
277 275
    public List<DocumentSearchResult> findByNameExactSearch(
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/NameServiceImpl.java
193 193

  
194 194
    @Override
195 195
    @Transactional
196
    public DeleteResult deleteTypeDesignation(TaxonName name, TypeDesignationBase typeDesignation){
196
    public DeleteResult deleteTypeDesignation(TaxonName name, TypeDesignationBase<?> typeDesignation){
197 197
    	if(typeDesignation != null && typeDesignation .isPersited()){
198 198
    		typeDesignation = HibernateProxyHelper.deproxy(referencedEntityDao.load(typeDesignation.getUuid()), TypeDesignationBase.class);
199 199
    	}
......
206 206
            removeSingleDesignation(name, typeDesignation);
207 207
        }else if (name != null){
208 208
            @SuppressWarnings("rawtypes")
209
            Set<TypeDesignationBase> designationSet = new HashSet<>(name.getTypeDesignations());
209
            Set<TypeDesignationBase<?>> designationSet = new HashSet<>(name.getTypeDesignations());
210 210
            for (TypeDesignationBase<?> desig : designationSet){
211 211
                desig = CdmBase.deproxy(desig);
212 212
                removeSingleDesignation(name, desig);
......
238 238
     * @param typeDesignation
239 239
     */
240 240
    @Transactional
241
    private void removeSingleDesignation(TaxonName name, TypeDesignationBase typeDesignation) {
241
    private void removeSingleDesignation(TaxonName name, TypeDesignationBase<?> typeDesignation) {
242

  
242 243
        name.removeTypeDesignation(typeDesignation);
243 244
        if (typeDesignation.getTypifiedNames().isEmpty()){
244 245
            typeDesignation.removeType();
......
249 250
                    }
250 251
                }
251 252
            }
253

  
252 254
            typeDesignationDao.delete(typeDesignation);
253 255

  
254 256
        }
......
398 400
     */
399 401
    @Override
400 402
    @Transactional(readOnly = false)
401
    public Map<UUID, TypeDesignationBase> saveTypeDesignationAll(Collection<TypeDesignationBase> typeDesignationCollection){
403
    public Map<UUID, TypeDesignationBase<?>> saveTypeDesignationAll(Collection<TypeDesignationBase<?>> typeDesignationCollection){
402 404
        return typeDesignationDao.saveAll(typeDesignationCollection);
403 405
    }
404 406

  
......
426 428
     * new name getTypeDesignations
427 429
     */
428 430
    @Override
429
    public List<TypeDesignationBase> getAllTypeDesignations(int limit, int start){
431
    public List<TypeDesignationBase<?>> getAllTypeDesignations(int limit, int start){
430 432
        return typeDesignationDao.getAllTypeDesignations(limit, start);
431 433
    }
432 434

  
433 435
    @Override
434
    public TypeDesignationBase loadTypeDesignation(int id, List<String> propertyPaths){
436
    public TypeDesignationBase<?> loadTypeDesignation(int id, List<String> propertyPaths){
435 437
        return typeDesignationDao.load(id, propertyPaths);
436 438
    }
437 439

  
438 440
    @Override
439
    public TypeDesignationBase loadTypeDesignation(UUID uuid, List<String> propertyPaths){
441
    public TypeDesignationBase<?> loadTypeDesignation(UUID uuid, List<String> propertyPaths){
440 442
        return typeDesignationDao.load(uuid, propertyPaths);
441 443
    }
442 444

  
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/dto/RegistrationDTO.java
323 323
     * @param ref
324 324
     * @return
325 325
     */
326
    private TypeDesignationBase findTypeDesignation(EntityReference ref) {
326
    private TypeDesignationBase<?> findTypeDesignation(EntityReference ref) {
327 327
        return typeDesignationManager != null ? typeDesignationManager.findTypeDesignation(ref) : null;
328 328
    }
329 329

  
330
    public Collection<TypeDesignationBase> typeDesignations() {
330
    public Collection<TypeDesignationBase<?>> typeDesignations() {
331 331
        return typeDesignationManager != null ? typeDesignationManager.getTypeDesignations() : null;
332 332
    }
333 333

  
......
368 368
            } else {
369 369
                bibliographicCitationString = citation.generateTitle();
370 370
            }
371
    
371

  
372 372
        }
373 373
    }
374 374

  
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/name/TypeDesignationSetManager.java
87 87
    private static final String REFERENCE_PARENTHESIS_RIGHT = "]";
88 88
    private static final String REFERENCE_PARENTHESIS_LEFT = " [";
89 89
    private static final String REFERENCE_FIDE = "fide ";
90
    private Map<UUID,TypeDesignationBase> typeDesignations;
90

  
91
    private Map<UUID,TypeDesignationBase<?>> typeDesignations;
91 92

  
92 93
    private NameTypeBaseEntityType nameTypeBaseEntityType = NameTypeBaseEntityType.NAME_TYPE_DESIGNATION;
93 94

  
......
137 138
     */
138 139
    public TypeDesignationSetManager(HomotypicalGroup group) throws RegistrationValidationException {
139 140
        if (this.typeDesignations == null){
140
            this.typeDesignations = new HashMap();
141
            this.typeDesignations = new HashMap<>();
141 142
        }
142
        for (TypeDesignationBase typeDes:group.getTypeDesignations()){
143
        for (TypeDesignationBase<?> typeDes:group.getTypeDesignations()){
143 144
            this.typeDesignations.put(typeDes.getUuid(), typeDes);
144 145
        }
145 146
        //findTypifiedName();
......
175 176
     */
176 177
    protected void mapAndSort() {
177 178
        finalString = null;
178
        Map<TypedEntityReference, TypeDesignationWorkingSet> byBaseEntityByTypeStatus = new HashMap<>();
179
        Map<TypedEntityReference<?>, TypeDesignationWorkingSet> byBaseEntityByTypeStatus = new HashMap<>();
179 180

  
180 181
        this.typeDesignations.values().forEach(td -> mapTypeDesignation(byBaseEntityByTypeStatus, td));
181 182
        orderedByTypesByBaseEntity = orderByTypeByBaseEntity(byBaseEntityByTypeStatus);
......
186 187
     * @param byBaseEntityByTypeStatus
187 188
     * @param td
188 189
     */
189
    private void mapTypeDesignation(Map<TypedEntityReference, TypeDesignationWorkingSet> byBaseEntityByTypeStatus,
190
    private void mapTypeDesignation(Map<TypedEntityReference<?>, TypeDesignationWorkingSet> byBaseEntityByTypeStatus,
190 191
            TypeDesignationBase<?> td){
191 192

  
192
        TypeDesignationStatusBase<?> status = td.getTypeStatus();
193
        TypeDesignationStatusBase status = td.getTypeStatus();
193 194

  
194 195
        try {
195 196
            final VersionableEntity baseEntity = baseEntity(td);
196 197
            final TypedEntityReference<VersionableEntity> baseEntityReference = makeEntityReference(baseEntity);
197 198

  
198
            TypedEntityReference typeDesignationEntityReference = new TypedEntityReference(
199
            TypedEntityReference<?> typeDesignationEntityReference = new TypedEntityReference<>(
199 200
                    HibernateProxyHelper.deproxy(td).getClass(),
200 201
                    td.getUuid(),
201 202
                    stringify(td));
......
259 260

  
260 261

  
261 262
    private LinkedHashMap<TypedEntityReference, TypeDesignationWorkingSet> orderByTypeByBaseEntity(
262
            Map<TypedEntityReference, TypeDesignationWorkingSet> stringsByTypeByBaseEntity){
263
            Map<TypedEntityReference<?>, TypeDesignationWorkingSet> stringsByTypeByBaseEntity){
263 264

  
264 265
       // order the FieldUnit TypeName keys
265
       List<TypedEntityReference> baseEntityKeyList = new LinkedList<>(stringsByTypeByBaseEntity.keySet());
266
       Collections.sort(baseEntityKeyList, new Comparator<TypedEntityReference>(){
266
       List<TypedEntityReference<?>> baseEntityKeyList = new LinkedList<>(stringsByTypeByBaseEntity.keySet());
267
       Collections.sort(baseEntityKeyList, new Comparator<TypedEntityReference<?>>(){
267 268
        /**
268 269
         * Sorts the base entities (TypedEntityReference) in the following order:
269 270
         *
......
274 275
         * {@inheritDoc}
275 276
         */
276 277
        @Override
277
        public int compare(TypedEntityReference o1, TypedEntityReference o2) {
278
        public int compare(TypedEntityReference<?> o1, TypedEntityReference<?> o2) {
278 279

  
279 280
            Class type1 = o1.getType();
280 281
            Class type2 = o2.getType();
......
428 429
                            workingsetBuilder.add(TagEnum.label, typeStatus.getLabel() + (isPlural ? "s:" : ":"));
429 430
                         }
430 431
                        int typeDesignationCount = 0;
431
                        for(TypedEntityReference typeDesignationEntityReference : createSortedList(typeDesignationWorkingSet, typeStatus)) {
432
                        for(TypedEntityReference<?> typeDesignationEntityReference : createSortedList(typeDesignationWorkingSet, typeStatus)) {
432 433
                            if(typeDesignationCount++  > 0){
433 434
                               workingsetBuilder.add(TagEnum.separator, TYPE_DESIGNATION_SEPARATOR);
434 435
                            }
435 436

  
436 437
                            workingsetBuilder.add(TagEnum.typeDesignation, typeDesignationEntityReference.getLabel(), typeDesignationEntityReference);
437 438

  
438
                            TypeDesignationBase typeDes =  typeDesignations.get(typeDesignationEntityReference.getUuid());
439
                            TypeDesignationBase<?> typeDes =  typeDesignations.get(typeDesignationEntityReference.getUuid());
439 440
                            if (typeDes.getCitation() != null){
440 441
                               // workingsetBuilder.add(TagEnum.separator, REFERENCE_PARENTHESIS_LEFT);
441 442
                                String shortCitation = ((DefaultReferenceCacheStrategy)typeDes.getCitation().getCacheStrategy()).createShortCitation(typeDes.getCitation());
......
545 546
    /**
546 547
     * @return
547 548
     */
548
    public Collection<TypeDesignationBase> getTypeDesignations() {
549
    public Collection<TypeDesignationBase<?>> getTypeDesignations() {
549 550
        return typeDesignations.values();
550 551
    }
551 552

  
......
553 554
     * @param ref
554 555
     * @return
555 556
     */
556
    public TypeDesignationBase findTypeDesignation(EntityReference typeDesignationRef) {
557
    public TypeDesignationBase<?> findTypeDesignation(EntityReference typeDesignationRef) {
557 558
        return this.typeDesignations.get(typeDesignationRef.getUuid());
558 559
    }
559 560

  
......
566 567
     * @param td
567 568
     * @return
568 569
     */
569
    private String stringify(TypeDesignationBase td) {
570
    private String stringify(TypeDesignationBase<?> td) {
570 571

  
571 572
        if(td instanceof NameTypeDesignation){
572 573
            return stringify((NameTypeDesignation)td);
cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/NameServiceImplTest.java
710 710
        DerivedUnit specimen1 = CdmBase.deproxy(this.occurrenceService.load(UUID.fromString("0d19a9ca-21a7-4adb-8640-8d6719e15eea")), DerivedUnit.class);
711 711
        DerivedUnit fossil = CdmBase.deproxy(this.occurrenceService.load(UUID.fromString("4c48b7c8-4c8d-4e48-b083-0837fe51a0a9")), DerivedUnit.class);
712 712

  
713
        Set<TypeDesignationBase> desigs1 = name1.getTypeDesignations();
714
        Set<TypeDesignationBase> desigs2 = name2.getTypeDesignations();
715
        Set<TypeDesignationBase> desigs3 = name3.getTypeDesignations();
713
        Set<TypeDesignationBase<?>> desigs1 = name1.getTypeDesignations();
714
        Set<TypeDesignationBase<?>> desigs2 = name2.getTypeDesignations();
715
        Set<TypeDesignationBase<?>> desigs3 = name3.getTypeDesignations();
716 716

  
717 717
        Assert.assertEquals("name1 should have 2 type designations", 2, desigs1.size());
718 718
        Assert.assertEquals("name2 should have 1 type designations", 1, desigs2.size());
......
825 825

  
826 826
        TaxonName name3 = this.nameService.load(UUID.fromString("e1e66264-f16a-4df9-80fd-6ab5028a3c28"));
827 827

  
828
        Set<TypeDesignationBase> desigs3 = name3.getTypeDesignations();
828
        Set<TypeDesignationBase<?>> desigs3 = name3.getTypeDesignations();
829 829

  
830 830
        NameTypeDesignation desig3 = (NameTypeDesignation)name3.getTypeDesignations().iterator().next();
831 831
        name3.addTypeDesignation(SpecimenTypeDesignation.NewInstance(), false);
......
889 889
        DerivedUnit specimen1 = CdmBase.deproxy(this.occurrenceService.load(UUID.fromString("0d19a9ca-21a7-4adb-8640-8d6719e15eea")), DerivedUnit.class);
890 890
        DerivedUnit fossil = CdmBase.deproxy(this.occurrenceService.load(UUID.fromString("4c48b7c8-4c8d-4e48-b083-0837fe51a0a9")), DerivedUnit.class);
891 891

  
892
        Set<TypeDesignationBase> desigs1 = name1.getTypeDesignations();
893
        Set<TypeDesignationBase> desigs2 = name2.getTypeDesignations();
894
        Set<TypeDesignationBase> desigs3 = name3.getTypeDesignations();
892
        Set<TypeDesignationBase<?>> desigs1 = name1.getTypeDesignations();
893
        Set<TypeDesignationBase<?>> desigs2 = name2.getTypeDesignations();
894
        Set<TypeDesignationBase<?>> desigs3 = name3.getTypeDesignations();
895 895

  
896 896
        Assert.assertEquals("name1 should have 2 type designations", 2, desigs1.size());
897 897
        Assert.assertEquals("name2 should have 1 type designations", 1, desigs2.size());
cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/OccurrenceServiceTest.java
296 296
        assertEquals("associated specimen is incorrect", associatedFieldUnit,
297 297
                ((IndividualsAssociation) descriptionElement).getAssociatedSpecimenOrObservation());
298 298
        // check initial state (Type Designation)
299
        Set<TypeDesignationBase> typeDesignations = name.getTypeDesignations();
299
        Set<TypeDesignationBase<?>> typeDesignations = name.getTypeDesignations();
300 300
        TypeDesignationBase<?> typeDesignation = typeDesignations.iterator().next();
301 301
        assertTrue("wrong type of type designation", typeDesignation.isInstanceOf(SpecimenTypeDesignation.class));
302 302
        assertEquals("type specimen is incorrect", typeSpecimen,

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)