Revision 31de786b
Added by Andreas Müller over 11 years ago
app-import/src/main/java/eu/etaxonomy/cdm/io/algaterra/AlgaTerraSpecimenImport.java | ||
---|---|---|
98 | 98 |
@Override |
99 | 99 |
protected String getRecordQuery(BerlinModelImportConfigurator config) { |
100 | 100 |
String strQuery = |
101 |
" SELECT PTaxon.RIdentifier as taxonId, Fact.FactId, Fact.RecordBasis, EcoFact.*, " + |
|
101 |
" SELECT PTaxon.RIdentifier as taxonId, Fact.FactId, Fact.RecordBasis, EcoFact.*, EcoFact.EcoFactId as unitId, " +
|
|
102 | 102 |
" tg.ID AS GazetteerId, tg.L2Code, tg.L3Code, tg.L4Code, tg.Country, tg.ISOCountry, " + |
103 |
" ec.UUID as climateUuid, eh.UUID as habitatUuid, elf.UUID as lifeFormUuid" + |
|
103 |
" ec.UUID as climateUuid, eh.UUID as habitatUuid, elf.UUID as lifeFormUuid " +
|
|
104 | 104 |
" FROM Fact " + |
105 | 105 |
" INNER JOIN EcoFact ON Fact.ExtensionFk = EcoFact.EcoFactId " + |
106 | 106 |
" INNER JOIN PTaxon ON dbo.Fact.PTNameFk = dbo.PTaxon.PTNameFk AND dbo.Fact.PTRefFk = dbo.PTaxon.PTRefFk " + |
... | ... | |
130 | 130 |
Set<TaxonBase> taxaToSave = new HashSet<TaxonBase>(); |
131 | 131 |
|
132 | 132 |
Map<String, TaxonBase> taxonMap = (Map<String, TaxonBase>) partitioner.getObjectMap(BerlinModelTaxonImport.NAMESPACE); |
133 |
Map<String, DerivedUnit> ecoFactMap = (Map<String, DerivedUnit>) partitioner.getObjectMap(ECO_FACT_NAMESPACE);
|
|
133 |
Map<String, DerivedUnit> ecoFactDerivedUnitMap = (Map<String, DerivedUnit>) partitioner.getObjectMap(ECO_FACT_DERIVED_UNIT_NAMESPACE);
|
|
134 | 134 |
|
135 | 135 |
ResultSet rs = partitioner.getResultSet(); |
136 | 136 |
|
... | ... | |
155 | 155 |
|
156 | 156 |
//facade |
157 | 157 |
DerivedUnitType type = makeDerivedUnitType(recordBasis); |
158 |
DerivedUnitFacade facade = getDerivedUnit(state, ecoFactId, ecoFactMap, type); |
|
158 |
DerivedUnitFacade facade = getDerivedUnit(state, ecoFactId, ecoFactDerivedUnitMap, type);
|
|
159 | 159 |
|
160 | 160 |
//field observation |
161 | 161 |
handleSingleSpecimen(rs, facade, state, partitioner); |
... | ... | |
193 | 193 |
return false; |
194 | 194 |
} |
195 | 195 |
} |
196 |
|
|
197 |
protected String getDerivedUnitNameSpace(){ |
|
198 |
return ECO_FACT_DERIVED_UNIT_NAMESPACE; |
|
199 |
} |
|
196 | 200 |
|
197 | 201 |
|
198 | 202 |
|
... | ... | |
485 | 489 |
result.put(nameSpace, objectMap); |
486 | 490 |
|
487 | 491 |
//field observation map map |
488 |
nameSpace = AlgaTerraSpecimenImport.ECO_FACT_NAMESPACE; |
|
492 |
nameSpace = AlgaTerraSpecimenImport.ECO_FACT_FIELD_OBSERVATION_NAMESPACE;
|
|
489 | 493 |
cdmClass = FieldObservation.class; |
490 | 494 |
idSet = fieldObservationIdSet; |
491 | 495 |
Map<String, FieldObservation> fieldObservationMap = (Map<String, FieldObservation>)getCommonService().getSourcedObjectsByIdInSource(cdmClass, idSet, nameSpace); |
Also available in: Unified diff
image imports for AlgaTerra (cont.)