Revision 6243a668
Added by Andreas Müller almost 12 years ago
app-import/src/main/java/eu/etaxonomy/cdm/io/algaterra/AlgaTerraSpecimenImportBase.java | ||
---|---|---|
13 | 13 |
import java.sql.Date; |
14 | 14 |
import java.sql.ResultSet; |
15 | 15 |
import java.sql.SQLException; |
16 |
import java.util.Map; |
|
16 | 17 |
import java.util.Set; |
17 | 18 |
import java.util.UUID; |
18 | 19 |
|
... | ... | |
22 | 23 |
|
23 | 24 |
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade; |
24 | 25 |
import eu.etaxonomy.cdm.io.berlinModel.in.BerlinModelImportBase; |
26 |
import eu.etaxonomy.cdm.io.berlinModel.in.BerlinModelTaxonNameImport; |
|
27 |
import eu.etaxonomy.cdm.io.common.ResultSetPartitioner; |
|
25 | 28 |
import eu.etaxonomy.cdm.io.common.Source; |
26 | 29 |
import eu.etaxonomy.cdm.model.agent.Team; |
27 | 30 |
import eu.etaxonomy.cdm.model.common.OrderedTermVocabulary; |
... | ... | |
35 | 38 |
import eu.etaxonomy.cdm.model.location.ReferenceSystem; |
36 | 39 |
import eu.etaxonomy.cdm.model.location.TdwgArea; |
37 | 40 |
import eu.etaxonomy.cdm.model.location.WaterbodyOrCountry; |
41 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase; |
|
42 |
import eu.etaxonomy.cdm.model.occurrence.Collection; |
|
38 | 43 |
|
39 | 44 |
/** |
40 | 45 |
* @author a.mueller |
... | ... | |
148 | 153 |
return "Locality"; |
149 | 154 |
} |
150 | 155 |
|
151 |
protected void handleSingleSpecimen(ResultSet rs, DerivedUnitFacade facade, AlgaTerraImportState state) throws SQLException { |
|
156 |
protected void handleSingleSpecimen(ResultSet rs, DerivedUnitFacade facade, AlgaTerraImportState state, ResultSetPartitioner partitioner) throws SQLException {
|
|
152 | 157 |
//FIXME missing fields #3084, #3085, #3080 |
153 | 158 |
try { |
154 | 159 |
|
... | ... | |
167 | 172 |
String collectorsNumber = rs.getString("CollectorsNumber"); |
168 | 173 |
Date collectionDateStart = rs.getDate("CollectionDate"); |
169 | 174 |
Date collectionDateEnd = rs.getDate("CollectionDateEnd"); |
170 |
|
|
175 |
|
|
176 |
Integer collectionFk = nullSafeInt(rs,"CollectionFk"); |
|
177 |
|
|
178 |
|
|
171 | 179 |
//location |
172 | 180 |
facade.setLocality(locality); |
173 | 181 |
|
... | ... | |
204 | 212 |
facade.setDistanceToWaterSurface(intDepth); |
205 | 213 |
} |
206 | 214 |
} |
207 |
|
|
208 | 215 |
|
209 | 216 |
//field |
210 | 217 |
facade.setFieldNumber(collectorsNumber); |
... | ... | |
215 | 222 |
//areas |
216 | 223 |
makeAreas(state, rs, facade); |
217 | 224 |
|
225 |
//collection |
|
226 |
if (collectionFk != null){ |
|
227 |
Collection subCollection = state.getRelatedObject(AlgaTerraCollectionImport.NAMESPACE_SUBCOLLECTION, String.valueOf(collectionFk), Collection.class); |
|
228 |
if (subCollection != null){ |
|
229 |
facade.setCollection(subCollection); |
|
230 |
}else{ |
|
231 |
Collection collection = state.getRelatedObject(AlgaTerraCollectionImport.NAMESPACE_COLLECTION, String.valueOf(collectionFk), Collection.class); |
|
232 |
facade.setCollection(collection); |
|
233 |
} |
|
234 |
} |
|
218 | 235 |
|
219 | 236 |
//notes |
220 | 237 |
//TODO is this an annotation on field observation or on the derived unit? |
Also available in: Unified diff
adding collections to AlgaTerra import