Revision 40bb5f10
Added by Andreas Müller over 4 years ago
cdm-pesi/src/main/java/eu/etaxonomy/cdm/io/pesi/indexFungorum/IndexFungorumDistributionImport.java | ||
---|---|---|
31 | 31 |
import eu.etaxonomy.cdm.model.location.NamedArea; |
32 | 32 |
import eu.etaxonomy.cdm.model.reference.Reference; |
33 | 33 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
34 |
import eu.etaxonomy.cdm.model.taxon.TaxonBase; |
|
35 | 34 |
|
36 | 35 |
/** |
37 | 36 |
* @author a.mueller |
... | ... | |
128 | 127 |
return success; |
129 | 128 |
} |
130 | 129 |
|
131 |
private Taxon getParentTaxon(IndexFungorumImportState state, ResultSet rs) throws SQLException { |
|
132 |
Integer genusId = rs.getInt("PreferredNameFDCnumber"); |
|
133 |
|
|
134 |
Taxon taxon = state.getRelatedObject(NAMESPACE_GENERA, String.valueOf(genusId), Taxon.class); |
|
135 |
if (taxon == null){ |
|
136 |
logger.warn("Taxon not found for " + genusId); |
|
137 |
} |
|
138 |
return taxon; |
|
139 |
} |
|
140 |
|
|
141 | 130 |
@Override |
142 | 131 |
public Map<Object, Map<String, ? extends CdmBase>> getRelatedObjectsForPartition(ResultSet rs, IndexFungorumImportState state) { |
143 | 132 |
|
... | ... | |
154 | 143 |
//taxon map |
155 | 144 |
nameSpace = NAMESPACE_SPECIES; |
156 | 145 |
idSet = taxonIdSet; |
157 |
@SuppressWarnings({ "rawtypes" }) |
|
158 |
Map<String, TaxonBase> taxonMap = getCommonService().getSourcedObjectsByIdInSourceC(TaxonBase.class, idSet, nameSpace); |
|
146 |
Map<String, Taxon> taxonMap = getCommonService().getSourcedObjectsByIdInSourceC(Taxon.class, idSet, nameSpace); |
|
159 | 147 |
result.put(nameSpace, taxonMap); |
160 | 148 |
|
161 | 149 |
//sourceReference |
... | ... | |
179 | 167 |
protected boolean isIgnore(IndexFungorumImportState state){ |
180 | 168 |
return ! state.getConfig().isDoOccurrence(); |
181 | 169 |
} |
182 |
}
|
|
170 |
} |
Also available in: Unified diff
ref #2826 improve IF import to PESI (merge) requirements