Project

General

Profile

« Previous | Next » 

Revision 97616c01

Added by Patrick Plitzner almost 8 years ago

comments

View differences:

app-import/src/main/java/eu/etaxonomy/cdm/io/redlist/gefaesspflanzen/RedListGefaesspflanzenImportClassification.java
23 23
import eu.etaxonomy.cdm.model.common.CdmBase;
24 24
import eu.etaxonomy.cdm.model.taxon.Classification;
25 25
import eu.etaxonomy.cdm.model.taxon.Synonym;
26
import eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType;
27 26
import eu.etaxonomy.cdm.model.taxon.Taxon;
28 27
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
29 28

  
......
102 101
        }
103 102
        else if(taxonBase.isInstanceOf(Synonym.class)){
104 103
            if(gueltString.equals("b")){
105

  
104
                //TODO
106 105
            }
107 106
            else{
108
                parent.addSynonym((Synonym) taxonBase, SynonymRelationshipType.SYNONYM_OF());
107
                //TODO: how to correctly add a synonym?
108
                parent.addHomotypicSynonym((Synonym) taxonBase, null, null);
109 109
            }
110 110
        }
111

  
112 111
    }
113 112

  
114 113
    @Override
115 114
    public Map<Object, Map<String, ? extends CdmBase>> getRelatedObjectsForPartition(ResultSet rs,
116 115
            RedListGefaesspflanzenImportState state) {
117 116
        Map<Object, Map<String, ? extends CdmBase>> result = new HashMap<>();
118
        Map<String, TaxonBase> taxonMap = new HashMap<String, TaxonBase>();
119
        try {
120
            while (rs.next()){
121
                long id = rs.getLong("NAMNR");
122
                long parentId = rs.getLong("LOWER");
123
//                taxonMap.put(String.valueOf(id), getTaxonService().load(state.getTaxonMap().get(id)));
124
                taxonMap.put(String.valueOf(parentId), getTaxonService().load(state.getTaxonMap().get(parentId)));
125
            }
126
        } catch (SQLException e) {
127
            e.printStackTrace();
128
        }
129
        result.put(Namespace.TAXON_NAMESPACE, taxonMap);
130

  
131 117
        return result;
132 118
    }
133 119

  

Also available in: Unified diff