Revision ffd6058e
Added by Andreas Müller over 4 years ago
cdm-pesi/src/main/java/eu/etaxonomy/cdm/io/pesi/indexFungorum/IndexFungorumHigherClassificationImport.java | ||
---|---|---|
32 | 32 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
33 | 33 |
import eu.etaxonomy.cdm.model.taxon.TaxonBase; |
34 | 34 |
|
35 |
|
|
36 | 35 |
/** |
37 | 36 |
* @author a.mueller |
38 | 37 |
* @since 27.02.2012 |
39 | 38 |
*/ |
40 | 39 |
@Component |
41 | 40 |
public class IndexFungorumHigherClassificationImport extends IndexFungorumImportBase { |
42 |
private static final Logger logger = Logger.getLogger(IndexFungorumHigherClassificationImport.class); |
|
41 |
|
|
42 |
private static final long serialVersionUID = -6841466146506309309L; |
|
43 |
private static final Logger logger = Logger.getLogger(IndexFungorumHigherClassificationImport.class); |
|
43 | 44 |
|
44 | 45 |
private static final String pluralString = "higher classifications"; |
45 | 46 |
private static final String dbTableName = "tblPESIfungi-Classification"; |
... | ... | |
48 | 49 |
super(pluralString, dbTableName, null); |
49 | 50 |
} |
50 | 51 |
|
51 |
|
|
52 | 52 |
@Override |
53 | 53 |
protected String getRecordQuery(IndexFungorumImportConfigurator config) { |
54 | 54 |
String strRecordQuery = |
... | ... | |
60 | 60 |
return strRecordQuery; |
61 | 61 |
} |
62 | 62 |
|
63 |
|
|
64 |
|
|
65 |
|
|
66 |
|
|
67 | 63 |
@Override |
68 | 64 |
protected void doInvoke(IndexFungorumImportState state) { |
65 |
|
|
66 |
logger.info("Start higher classification ..."); |
|
67 |
|
|
69 | 68 |
String sql = getRecordQuery(state.getConfig()); |
70 | 69 |
ResultSet rs = state.getConfig().getSource().getResultSet(sql); |
71 | 70 |
|
... | ... | |
93 | 92 |
|
94 | 93 |
Taxon higherTaxon = null; |
95 | 94 |
|
96 |
|
|
97 | 95 |
TransactionStatus tx = startTransaction(); |
98 | 96 |
ResultSet rsRelatedObjects = state.getConfig().getSource().getResultSet(sql); |
99 | 97 |
state.setRelatedObjects(getRelatedObjectsForPartition(rsRelatedObjects, state)); |
... | ... | |
186 | 184 |
//TaxonNode node = getClassification(state).getNode(taxonFamily); |
187 | 185 |
logger.warn(e.getMessage() + taxonFamily.getTitleCache() + " " + higherTaxon.getTitleCache()); |
188 | 186 |
|
189 |
|
|
190 |
|
|
191 | 187 |
} |
192 |
|
|
193 | 188 |
} |
194 | 189 |
} |
195 | 190 |
higherTaxon = isIncertisSedis(family) ? higherTaxon : taxonFamily; |
... | ... | |
227 | 222 |
state.setSuccess(false); |
228 | 223 |
} |
229 | 224 |
commitTransaction(tx); |
225 |
logger.info("End higher classification ..."); |
|
226 |
|
|
230 | 227 |
return; |
231 | 228 |
|
232 | 229 |
} |
Also available in: Unified diff
ref #2826 cleanup IF import