Project

General

Profile

Revision e1530610

IDe1530610e0fa48e67d4ffe738337628ced790423
Parent aecb5658
Child 3bbff684

Added by Andreas Müller over 2 years ago

add hybrid name save to import base class

View differences:

cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/common/CdmImportBase.java
60 60
import eu.etaxonomy.cdm.model.media.ImageFile;
61 61
import eu.etaxonomy.cdm.model.media.Media;
62 62
import eu.etaxonomy.cdm.model.media.MediaRepresentation;
63
import eu.etaxonomy.cdm.model.name.HybridRelationship;
63 64
import eu.etaxonomy.cdm.model.name.INonViralName;
65
import eu.etaxonomy.cdm.model.name.NameRelationship;
64 66
import eu.etaxonomy.cdm.model.name.Rank;
65 67
import eu.etaxonomy.cdm.model.name.RankClass;
66 68
import eu.etaxonomy.cdm.model.name.TaxonName;
......
1572 1574
        return author;
1573 1575
    }
1574 1576

  
1577
    /**
1578
     * Saves name relations. Needed if a name was parsed and has hybrid parents
1579
     * which will not be saved via cascade.
1580
     */
1581
    protected void saveNameRelations(TaxonName name) {
1582
        for (HybridRelationship rel: name.getHybridChildRelations()){
1583
            getNameService().saveOrUpdate(rel.getParentName());
1584
        }
1585
        for (NameRelationship rel: name.getNameRelations()){
1586
            getNameService().saveOrUpdate(rel.getFromName());
1587
            getNameService().saveOrUpdate(rel.getToName());
1588
        }
1589
    }
1590

  
1575 1591

  
1576 1592
}

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)