Revision a399b702
Added by U-BGBM\k.luther over 8 years ago
cdm-pesi/src/main/java/eu/etaxonomy/cdm/io/pesi/faunaEuropaea/FaunaEuropaeaDistributionImport.java | ||
---|---|---|
22 | 22 |
import org.springframework.stereotype.Component; |
23 | 23 |
import org.springframework.transaction.TransactionStatus; |
24 | 24 |
|
25 |
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper; |
|
25 | 26 |
import eu.etaxonomy.cdm.io.common.Source; |
26 | 27 |
import eu.etaxonomy.cdm.model.common.CdmBase; |
28 |
import eu.etaxonomy.cdm.model.common.OrderedTermVocabulary; |
|
27 | 29 |
import eu.etaxonomy.cdm.model.common.TermVocabulary; |
28 | 30 |
import eu.etaxonomy.cdm.model.description.Distribution; |
29 | 31 |
import eu.etaxonomy.cdm.model.description.PresenceAbsenceTerm; |
... | ... | |
72 | 74 |
logger.warn("Start distribution doInvoke"); |
73 | 75 |
ProfilerController.memorySnapshot(); |
74 | 76 |
*/ |
77 |
|
|
78 |
if (!state.getConfig().isDoOccurrence()){ |
|
79 |
return; |
|
80 |
} |
|
81 |
|
|
75 | 82 |
int limit = state.getConfig().getLimitSave(); |
76 | 83 |
UUID noDataUuid; |
77 | 84 |
/* Taxon store for retrieving taxa from and saving taxa to CDM */ |
... | ... | |
87 | 94 |
//txStatus = startTransaction(); |
88 | 95 |
PresenceAbsenceTerm noDataStatusTerm = PresenceAbsenceTerm.NewPresenceInstance("no data", "no data", "nod"); |
89 | 96 |
noDataUuid = noDataStatusTerm.getUuid(); |
90 |
TermVocabulary voc = getVocabularyService().find(30); |
|
91 |
voc.addTerm(noDataStatusTerm); |
|
92 |
getVocabularyService().saveOrUpdate(voc); |
|
93 |
// getTermService().save(noDataStatusTerm); |
|
97 |
TermVocabulary<PresenceAbsenceTerm> voc = getVocabularyService().find(30); |
|
98 |
HibernateProxyHelper.deproxy(voc, OrderedTermVocabulary.class); |
|
99 |
//voc.addTerm(noDataStatusTerm); |
|
100 |
// getVocabularyService().saveOrUpdate(voc); |
|
101 |
getTermService().save(noDataStatusTerm); |
|
94 | 102 |
//commitTransaction(txStatus); |
95 | 103 |
|
96 | 104 |
FaunaEuropaeaTransformer.setUUIDs(noDataUuid); |
... | ... | |
224 | 232 |
|
225 | 233 |
if(logger.isInfoEnabled()) { logger.info("End making distributions..."); } |
226 | 234 |
|
235 |
|
|
227 | 236 |
return; |
228 | 237 |
} |
229 | 238 |
|
Also available in: Unified diff
changes for fauna europaea import