Revision b313991f
Added by Andreas Müller over 4 years ago
app-import/src/main/java/eu/etaxonomy/cdm/io/berlinModel/in/BerlinModelOccurrenceSourceImport.java | ||
---|---|---|
177 | 177 |
|
178 | 178 |
@Override |
179 | 179 |
public Map<Object, Map<String, ? extends CdmBase>> getRelatedObjectsForPartition(ResultSet rs, BerlinModelImportState state) { |
180 |
String nameSpace; |
|
181 |
Class<?> cdmClass;
|
|
180 |
|
|
181 |
String nameSpace;
|
|
182 | 182 |
Set<String> idSet; |
183 | 183 |
Map<Object, Map<String, ? extends CdmBase>> result = new HashMap<>(); |
184 | 184 |
|
... | ... | |
204 | 204 |
|
205 | 205 |
//occurrence map |
206 | 206 |
nameSpace = BerlinModelOccurrenceImport.NAMESPACE; |
207 |
cdmClass = Distribution.class; |
|
208 | 207 |
idSet = occurrenceIdSet; |
209 |
@SuppressWarnings("unchecked") |
|
210 |
Map<String, Distribution> occurrenceMap = (Map<String, Distribution>)getCommonService().getSourcedObjectsByIdInSource(cdmClass, idSet, nameSpace); |
|
208 |
Map<String, Distribution> occurrenceMap = getCommonService().getSourcedObjectsByIdInSourceC(Distribution.class, idSet, nameSpace); |
|
211 | 209 |
result.put(nameSpace, occurrenceMap); |
212 | 210 |
|
213 | 211 |
//name map |
214 | 212 |
nameSpace = BerlinModelTaxonNameImport.NAMESPACE; |
215 |
cdmClass = TaxonName.class; |
|
216 | 213 |
idSet =nameIdSet; |
217 |
@SuppressWarnings("unchecked") |
|
218 |
Map<String, TaxonName> nameMap = (Map<String, TaxonName>)getCommonService().getSourcedObjectsByIdInSource(cdmClass, idSet, nameSpace); |
|
214 |
Map<String, TaxonName> nameMap = getCommonService().getSourcedObjectsByIdInSourceC(TaxonName.class, idSet, nameSpace); |
|
219 | 215 |
result.put(nameSpace, nameMap); |
220 | 216 |
|
221 | 217 |
//reference map |
222 | 218 |
nameSpace = BerlinModelReferenceImport.REFERENCE_NAMESPACE; |
223 |
cdmClass = Reference.class; |
|
224 |
idSet = referenceIdSet; |
|
225 |
@SuppressWarnings("unchecked") |
|
226 |
Map<String, Reference> referenceMap = (Map<String, Reference>)getCommonService().getSourcedObjectsByIdInSource(cdmClass, idSet, nameSpace); |
|
219 |
Map<String, Reference> referenceMap = getCommonService().getSourcedObjectsByIdInSourceC(Reference.class, idSet, nameSpace); |
|
227 | 220 |
result.put(nameSpace, referenceMap); |
228 | 221 |
|
229 | 222 |
} catch (SQLException e) { |
... | ... | |
264 | 257 |
return oldNameIdSet; |
265 | 258 |
} |
266 | 259 |
|
267 |
|
|
268 |
|
|
269 |
/** |
|
270 |
* @param state |
|
271 |
* @param oldNameStr |
|
272 |
* @param oldNameFk |
|
273 |
* @return |
|
274 |
*/ |
|
275 |
private TaxonName getName(BerlinModelImportState state, String oldNameStr, Integer oldNameFk, String oldNameFkFullCache, String oldNameFkCache, |
|
260 |
private TaxonName getName(BerlinModelImportState state, String oldNameStr, Integer oldNameFk, |
|
261 |
String oldNameFkFullCache, String oldNameFkCache, |
|
276 | 262 |
Integer occSourceId, Distribution distribution) { |
277 | 263 |
if (oldNameStr == null && oldNameFk == null){ |
278 | 264 |
return null; |
Also available in: Unified diff
adapt some classes to new CommonService.getSourcedObjectSByIdInSource and cleanup