Revision 6243a668
Added by Andreas Müller over 11 years ago
app-import/src/main/java/eu/etaxonomy/cdm/io/algaterra/AlgaTerraSpecimenImport.java | ||
---|---|---|
50 | 50 |
import eu.etaxonomy.cdm.model.description.TextData; |
51 | 51 |
import eu.etaxonomy.cdm.model.name.BotanicalName; |
52 | 52 |
import eu.etaxonomy.cdm.model.name.Rank; |
53 |
import eu.etaxonomy.cdm.model.occurrence.Collection; |
|
53 | 54 |
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit; |
54 | 55 |
import eu.etaxonomy.cdm.model.occurrence.FieldObservation; |
55 | 56 |
import eu.etaxonomy.cdm.model.reference.Reference; |
... | ... | |
157 | 158 |
DerivedUnitFacade facade = getDerivedUnit(state, ecoFactId, ecoFactMap, type); |
158 | 159 |
|
159 | 160 |
//field observation |
160 |
handleSingleSpecimen(rs, facade, state); |
|
161 |
handleSingleSpecimen(rs, facade, state, partitioner);
|
|
161 | 162 |
|
162 | 163 |
handleEcoFactSpecificSpecimen(rs,facade, state); |
163 | 164 |
|
... | ... | |
465 | 466 |
Set<String> taxonIdSet = new HashSet<String>(); |
466 | 467 |
Set<String> fieldObservationIdSet = new HashSet<String>(); |
467 | 468 |
Set<String> termsIdSet = new HashSet<String>(); |
469 |
Set<String> collectionIdSet = new HashSet<String>(); |
|
468 | 470 |
|
469 | 471 |
while (rs.next()){ |
470 | 472 |
handleForeignKey(rs, taxonIdSet, "taxonId"); |
... | ... | |
472 | 474 |
handleForeignKey(rs, termsIdSet, "ClimateFk"); |
473 | 475 |
handleForeignKey(rs, termsIdSet, "HabitatFk"); |
474 | 476 |
handleForeignKey(rs, termsIdSet, "LifeFormFk"); |
477 |
handleForeignKey(rs, collectionIdSet, "CollectionFk"); |
|
475 | 478 |
} |
476 | 479 |
|
477 | 480 |
//taxon map |
... | ... | |
488 | 491 |
Map<String, FieldObservation> fieldObservationMap = (Map<String, FieldObservation>)getCommonService().getSourcedObjectsByIdInSource(cdmClass, idSet, nameSpace); |
489 | 492 |
result.put(nameSpace, fieldObservationMap); |
490 | 493 |
|
494 |
//collections |
|
495 |
nameSpace = AlgaTerraCollectionImport.NAMESPACE_COLLECTION; |
|
496 |
cdmClass = Collection.class; |
|
497 |
idSet = collectionIdSet; |
|
498 |
Map<String, Collection> collectionMap = (Map<String, Collection>)getCommonService().getSourcedObjectsByIdInSource(cdmClass, idSet, nameSpace); |
|
499 |
result.put(nameSpace, collectionMap); |
|
500 |
|
|
501 |
//sub-collections |
|
502 |
nameSpace = AlgaTerraCollectionImport.NAMESPACE_SUBCOLLECTION; |
|
503 |
cdmClass = Collection.class; |
|
504 |
idSet = collectionIdSet; |
|
505 |
Map<String, Collection> subCollectionMap = (Map<String, Collection>)getCommonService().getSourcedObjectsByIdInSource(cdmClass, idSet, nameSpace); |
|
506 |
result.put(nameSpace, subCollectionMap); |
|
507 |
|
|
491 | 508 |
//terms |
492 | 509 |
nameSpace = AlgaTerraSpecimenImport.TERMS_NAMESPACE; |
493 | 510 |
cdmClass = FieldObservation.class; |
Also available in: Unified diff
adding collections to AlgaTerra import