Revision e0935f63
Added by Andreas Müller over 4 years ago
app-import/src/main/java/eu/etaxonomy/cdm/io/algaterra/AlgaTerraCollectionImport.java | ||
---|---|---|
90 | 90 |
Set<Collection> collectionsToSave = new HashSet<Collection>(); |
91 | 91 |
|
92 | 92 |
|
93 |
Map<String, Collection> collectionMap = partitioner.getObjectMap(NAMESPACE_COLLECTION);
|
|
94 |
|
|
93 |
@SuppressWarnings("unchecked")
|
|
94 |
Map<String, Collection> collectionMap = partitioner.getObjectMap(NAMESPACE_COLLECTION); |
|
95 | 95 |
|
96 | 96 |
ResultSet rs = partitioner.getResultSet(); |
97 | 97 |
|
... | ... | |
198 | 198 |
@Override |
199 | 199 |
public Map<Object, Map<String, ? extends CdmBase>> getRelatedObjectsForPartition(ResultSet rs, BerlinModelImportState state) { |
200 | 200 |
String nameSpace; |
201 |
Class cdmClass; |
|
202 | 201 |
Set<String> idSet; |
203 |
Map<Object, Map<String, ? extends CdmBase>> result = new HashMap<Object, Map<String, ? extends CdmBase>>();
|
|
202 |
Map<Object, Map<String, ? extends CdmBase>> result = new HashMap<>(); |
|
204 | 203 |
|
205 | 204 |
try{ |
206 |
Set<String> collectionIdSet = new HashSet<String>();
|
|
205 |
Set<String> collectionIdSet = new HashSet<>(); |
|
207 | 206 |
|
208 | 207 |
while (rs.next()){ |
209 | 208 |
handleForeignKey(rs, collectionIdSet, "partOfFk"); |
... | ... | |
211 | 210 |
|
212 | 211 |
//type specimen map |
213 | 212 |
nameSpace = NAMESPACE_COLLECTION; |
214 |
cdmClass = Collection.class; |
|
215 | 213 |
idSet = collectionIdSet; |
216 |
Map<String, Collection> collectionMap = (Map<String, Collection>)getCommonService().getSourcedObjectsByIdInSource(cdmClass, idSet, nameSpace);
|
|
214 |
Map<String, Collection> collectionMap = getCommonService().getSourcedObjectsByIdInSourceC(Collection.class, idSet, nameSpace);
|
|
217 | 215 |
result.put(nameSpace, collectionMap); |
218 | 216 |
|
219 | 217 |
|
... | ... | |
224 | 222 |
|
225 | 223 |
} |
226 | 224 |
|
227 |
|
|
228 |
/* (non-Javadoc) |
|
229 |
* @see eu.etaxonomy.cdm.io.common.CdmIoBase#doCheck(eu.etaxonomy.cdm.io.common.IoStateBase) |
|
230 |
*/ |
|
231 | 225 |
@Override |
232 | 226 |
protected boolean doCheck(BerlinModelImportState state){ |
233 | 227 |
IOValidator<BerlinModelImportState> validator = new AlgaTerraCollectionImportValidator(); |
Also available in: Unified diff
adapt some classes to new CommonService.getSourcedObjectSByIdInSourceC and cleanup