Revision b313991f
Added by Andreas Müller over 4 years ago
cdm-pesi/src/main/java/eu/etaxonomy/cdm/io/pesi/erms/ErmsDistributionImport.java | ||
---|---|---|
132 | 132 |
|
133 | 133 |
@Override |
134 | 134 |
public Map<Object, Map<String, ? extends CdmBase>> getRelatedObjectsForPartition(ResultSet rs, ErmsImportState state) { |
135 |
String nameSpace; |
|
136 |
Class<?> cdmClass;
|
|
135 |
|
|
136 |
String nameSpace;
|
|
137 | 137 |
Set<String> idSet; |
138 | 138 |
Map<Object, Map<String, ? extends CdmBase>> result = new HashMap<>(); |
139 | 139 |
|
... | ... | |
149 | 149 |
|
150 | 150 |
//taxon map |
151 | 151 |
nameSpace = ErmsImportBase.TAXON_NAMESPACE; |
152 |
cdmClass = TaxonBase.class; |
|
153 | 152 |
idSet = taxonIdSet; |
154 |
@SuppressWarnings("unchecked")
|
|
155 |
Map<String, TaxonBase<?>> taxonMap = (Map<String, TaxonBase<?>>)getCommonService().getSourcedObjectsByIdInSource(cdmClass, idSet, nameSpace);
|
|
153 |
@SuppressWarnings("rawtypes")
|
|
154 |
Map<String, TaxonBase> taxonMap = getCommonService().getSourcedObjectsByIdInSourceC(TaxonBase.class, idSet, nameSpace);
|
|
156 | 155 |
result.put(nameSpace, taxonMap); |
157 | 156 |
|
158 | 157 |
//areas |
159 | 158 |
nameSpace = ErmsImportBase.AREA_NAMESPACE; |
160 |
cdmClass = NamedArea.class; |
|
161 | 159 |
idSet = areaIdSet; |
162 |
@SuppressWarnings("unchecked") |
|
163 |
Map<String, NamedArea> areaMap = (Map<String, NamedArea>)getCommonService().getSourcedObjectsByIdInSource(cdmClass, idSet, nameSpace); |
|
160 |
Map<String, NamedArea> areaMap = getCommonService().getSourcedObjectsByIdInSourceC(NamedArea.class, idSet, nameSpace); |
|
164 | 161 |
result.put(nameSpace, areaMap); |
165 | 162 |
|
166 | 163 |
//reference map |
167 | 164 |
nameSpace = ErmsImportBase.REFERENCE_NAMESPACE; |
168 |
cdmClass = Reference.class; |
|
169 | 165 |
idSet = sourceIdSet; |
170 |
@SuppressWarnings("unchecked") |
|
171 |
Map<String, Reference> referenceMap = (Map<String, Reference>)getCommonService().getSourcedObjectsByIdInSource(cdmClass, idSet, nameSpace); |
|
166 |
Map<String, Reference> referenceMap = getCommonService().getSourcedObjectsByIdInSourceC(Reference.class, idSet, nameSpace); |
|
172 | 167 |
result.put(nameSpace, referenceMap); |
173 | 168 |
|
174 | 169 |
} catch (SQLException e) { |
Also available in: Unified diff
adapt some classes to new CommonService.getSourcedObjectSByIdInSource and cleanup