Revision 15ce3c9c
Added by Niels Hoffmann over 13 years ago
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/ITaxonService.java | ||
---|---|---|
23 | 23 |
import eu.etaxonomy.cdm.model.name.Rank; |
24 | 24 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase; |
25 | 25 |
import eu.etaxonomy.cdm.model.reference.Reference; |
26 |
import eu.etaxonomy.cdm.model.taxon.Classification; |
|
26 | 27 |
import eu.etaxonomy.cdm.model.taxon.Synonym; |
27 | 28 |
import eu.etaxonomy.cdm.model.taxon.SynonymRelationship; |
28 | 29 |
import eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType; |
... | ... | |
31 | 32 |
import eu.etaxonomy.cdm.model.taxon.TaxonNode; |
32 | 33 |
import eu.etaxonomy.cdm.model.taxon.TaxonRelationship; |
33 | 34 |
import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType; |
34 |
import eu.etaxonomy.cdm.model.taxon.Classification; |
|
35 | 35 |
import eu.etaxonomy.cdm.persistence.dao.BeanInitializer; |
36 | 36 |
import eu.etaxonomy.cdm.persistence.fetch.CdmFetch; |
37 |
import eu.etaxonomy.cdm.persistence.query.MatchMode; |
|
38 | 37 |
import eu.etaxonomy.cdm.persistence.query.OrderHint; |
39 | 38 |
|
40 | 39 |
|
... | ... | |
194 | 193 |
*/ |
195 | 194 |
public Taxon changeSynonymToRelatedTaxon(Synonym synonym, Taxon toTaxon, TaxonRelationshipType taxonRelationshipType, Reference citation, String microcitation); |
196 | 195 |
|
196 |
|
|
197 |
/** |
|
198 |
* Move a synonym to another taxon, effectively removing the old synonym relationship |
|
199 |
* |
|
200 |
* @param synonymRelation |
|
201 |
* @param toTaxon |
|
202 |
* @param reference |
|
203 |
* @param referenceDetail |
|
204 |
* @return |
|
205 |
*/ |
|
206 |
public Taxon moveSynonymToAnotherTaxon(SynonymRelationship synonymRelation, Taxon toTaxon, SynonymRelationshipType synonymRelationshipType, Reference reference, String referenceDetail); |
|
207 |
|
|
197 | 208 |
/** |
198 | 209 |
* Returns the TaxonRelationships (of where relationship.type == type, if this argument is supplied) |
199 | 210 |
* where the supplied taxon is relatedTo. |
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/TaxonServiceImpl.java | ||
---|---|---|
42 | 42 |
import eu.etaxonomy.cdm.model.name.Rank; |
43 | 43 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase; |
44 | 44 |
import eu.etaxonomy.cdm.model.reference.Reference; |
45 |
import eu.etaxonomy.cdm.model.taxon.Classification; |
|
45 | 46 |
import eu.etaxonomy.cdm.model.taxon.Synonym; |
46 | 47 |
import eu.etaxonomy.cdm.model.taxon.SynonymRelationship; |
47 | 48 |
import eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType; |
... | ... | |
50 | 51 |
import eu.etaxonomy.cdm.model.taxon.TaxonNode; |
51 | 52 |
import eu.etaxonomy.cdm.model.taxon.TaxonRelationship; |
52 | 53 |
import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType; |
53 |
import eu.etaxonomy.cdm.model.taxon.Classification; |
|
54 | 54 |
import eu.etaxonomy.cdm.persistence.dao.common.IOrderedTermVocabularyDao; |
55 | 55 |
import eu.etaxonomy.cdm.persistence.dao.description.IDescriptionDao; |
56 | 56 |
import eu.etaxonomy.cdm.persistence.dao.name.ITaxonNameDao; |
... | ... | |
666 | 666 |
} |
667 | 667 |
return null; |
668 | 668 |
} |
669 |
|
|
670 |
/* (non-Javadoc) |
|
671 |
* @see eu.etaxonomy.cdm.api.service.ITaxonService#moveSynonymToAnotherTaxon(eu.etaxonomy.cdm.model.taxon.SynonymRelationship, eu.etaxonomy.cdm.model.taxon.Taxon, eu.etaxonomy.cdm.model.reference.Reference, java.lang.String) |
|
672 |
*/ |
|
673 |
@Override |
|
674 |
public Taxon moveSynonymToAnotherTaxon(SynonymRelationship synonymRelation, |
|
675 |
Taxon toTaxon, SynonymRelationshipType synonymRelationshipType, Reference reference, String referenceDetail) { |
|
676 |
Taxon fromTaxon = synonymRelation.getAcceptedTaxon(); |
|
677 |
|
|
678 |
fromTaxon.removeSynonymRelation(synonymRelation); |
|
679 |
|
|
680 |
toTaxon.addSynonym(synonymRelation.getSynonym(), synonymRelationshipType); |
|
681 |
|
|
682 |
return toTaxon; |
|
683 |
} |
|
669 | 684 |
|
670 | 685 |
|
671 | 686 |
} |
Also available in: Unified diff
implemented a method to move synonyms between taxa