Revision 3ef2e1bd
Added by Andreas Müller over 7 years ago
app-import/src/main/java/eu/etaxonomy/cdm/io/edaphobase/EdaphobaseSynonymyImport.java | ||
---|---|---|
24 | 24 |
import eu.etaxonomy.cdm.model.common.CdmBase; |
25 | 25 |
import eu.etaxonomy.cdm.model.reference.Reference; |
26 | 26 |
import eu.etaxonomy.cdm.model.taxon.Synonym; |
27 |
import eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType;
|
|
27 |
import eu.etaxonomy.cdm.model.taxon.SynonymType; |
|
28 | 28 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
29 | 29 |
import eu.etaxonomy.cdm.model.taxon.TaxonBase; |
30 | 30 |
|
... | ... | |
41 | 41 |
|
42 | 42 |
private static final String tableName = "tax_synonym"; |
43 | 43 |
|
44 |
private static final String pluralString = "synonym relationships";
|
|
44 |
private static final String pluralString = "related synonyms";
|
|
45 | 45 |
|
46 | 46 |
|
47 | 47 |
/** |
... | ... | |
92 | 92 |
if (synonymCandidate == null){ |
93 | 93 |
logger.warn("Synonym " + synId + " not found for synonymRelations (tax_synonym): " + id); |
94 | 94 |
}else if (synonymCandidate.isInstanceOf(Taxon.class)){ |
95 |
String message = "Synonym ("+synId+") is not synonym but accepted (valid). Can't add synonym relationship for tax_synonym: "+id;
|
|
95 |
String message = "Synonym ("+synId+") is not synonym but accepted (valid). Can't add synonym for tax_synonym: "+id; |
|
96 | 96 |
logger.warn(message); |
97 | 97 |
}else{ |
98 | 98 |
Synonym synonym = CdmBase.deproxy(synonymCandidate, Synonym.class); |
... | ... | |
100 | 100 |
if (accepted == null){ |
101 | 101 |
logger.warn("Accepted(parent) taxon " + accId + " not found for tax_synonym " + id ); |
102 | 102 |
}else if(accepted.isInstanceOf(Synonym.class)){ |
103 |
String message = "Taxon ("+accId+") is not accepted but synonym. Can't add synonym relationship for tax_synonym: "+id;
|
|
103 |
String message = "Taxon ("+accId+") is not accepted but synonym. Can't add synonym for tax_synonym: "+id; |
|
104 | 104 |
logger.warn(message); |
105 | 105 |
}else{ |
106 | 106 |
Taxon taxon = CdmBase.deproxy(accepted, Taxon.class); |
107 |
taxon.addSynonym(synonym, SynonymRelationshipType.SYNONYM_OF());
|
|
107 |
taxon.addSynonym(synonym, SynonymType.SYNONYM_OF()); |
|
108 | 108 |
taxaToSave.add(synonym); |
109 | 109 |
taxaToSave.add(taxon); |
110 | 110 |
} |
Also available in: Unified diff
ref #5974 Remove synonym relationships (not finished yet)