Project

General

Profile

Revision 337e5814

ID337e58143103f0b8d72c8f08ba30034cf3ef9c5b
Parent b5dbd2f6
Child afca67c8

Added by Katja Luther about 1 year ago

remove createSynonym method

View differences:

cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/ITaxonService.java
949 949
    public UpdateResult changeRelatedTaxonToSynonym(UUID fromTaxonUuid, UUID toTaxonUuid,
950 950
            TaxonRelationshipType oldRelationshipType, SynonymType synonymType) throws DataChangeNoRollbackException;
951 951

  
952
    /**
953
     * @param acceptedTaxonUuid
954
     * @param newName
955
     * @param type
956
     * @return
957
     */
958
    UpdateResult createSynonym(UUID acceptedTaxonUuid, Synonym synonym);
959

  
960 952

  
961 953

  
962 954

  
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/TaxonServiceImpl.java
96 96
import eu.etaxonomy.cdm.model.media.MediaRepresentation;
97 97
import eu.etaxonomy.cdm.model.media.MediaUtils;
98 98
import eu.etaxonomy.cdm.model.name.HomotypicalGroup;
99
import eu.etaxonomy.cdm.model.name.HybridRelationship;
100 99
import eu.etaxonomy.cdm.model.name.IZoologicalName;
101 100
import eu.etaxonomy.cdm.model.name.Rank;
102 101
import eu.etaxonomy.cdm.model.name.TaxonName;
......
293 292
        return result;
294 293
    }
295 294

  
296
    @Override
297
    @Transactional(readOnly = false)
298
    public UpdateResult createSynonym(UUID acceptedTaxonUuid,
299
            Synonym newSynonym)  {
300
        UpdateResult result = new UpdateResult();
301
        for (HybridRelationship rel : newSynonym.getName().getHybridChildRelations()){
302
            if (!rel.getHybridName().isPersited()) {
303
                nameService.save(rel.getHybridName());
304
            }
305
            if (!rel.getParentName().isPersited()) {
306
                nameService.save(rel.getParentName());
307
            }
308
        }
309
        Taxon acceptedTaxon = (Taxon)load(acceptedTaxonUuid);
310
        acceptedTaxon.addSynonym(newSynonym, newSynonym.getType());
311
        result.addUpdatedObject(acceptedTaxon);
312
        return result;
313

  
314
    }
315

  
316 295

  
317 296

  
318 297

  

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)