Revision 8422c0cd
Added by Andreas Müller almost 8 years ago
cdm-eflora/src/main/java/eu/etaxonomy/cdm/io/eflora/centralAfrica/checklist/CentralAfricaChecklistReferenceImport.java | ||
---|---|---|
1 | 1 |
/** |
2 | 2 |
* Copyright (C) 2007 EDIT |
3 |
* European Distributed Institute of Taxonomy
|
|
3 |
* European Distributed Institute of Taxonomy |
|
4 | 4 |
* http://www.e-taxonomy.eu |
5 |
*
|
|
5 |
* |
|
6 | 6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
7 | 7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
8 | 8 |
*/ |
... | ... | |
36 | 36 |
@Component |
37 | 37 |
public class CentralAfricaChecklistReferenceImport extends CentralAfricaChecklistImportBase<Reference> implements IMappingImport<Reference, CentralAfricaChecklistImportState>{ |
38 | 38 |
private static final Logger logger = Logger.getLogger(CentralAfricaChecklistReferenceImport.class); |
39 |
|
|
39 |
|
|
40 | 40 |
private DbImportMapping<?,?> mapping; |
41 |
|
|
41 |
|
|
42 | 42 |
// private int modCount = 10000; |
43 | 43 |
private static final String pluralString = "references"; |
44 | 44 |
private static final String dbTableName = "checklist"; |
... | ... | |
48 | 48 |
public CentralAfricaChecklistReferenceImport(){ |
49 | 49 |
super(pluralString, dbTableName, cdmTargetClass); |
50 | 50 |
} |
51 |
|
|
52 |
|
|
51 |
|
|
52 |
|
|
53 | 53 |
|
54 | 54 |
/* (non-Javadoc) |
55 | 55 |
* @see eu.etaxonomy.cdm.io.erms.ErmsImportBase#getIdQuery() |
... | ... | |
65 | 65 |
protected DbImportMapping<?,?> getMapping() { |
66 | 66 |
if (mapping == null){ |
67 | 67 |
mapping = new DbImportMapping(); |
68 |
mapping.addMapper(DbImportObjectCreationMapper.NewInstance(this, "source", REFERENCE_NAMESPACE));
|
|
68 |
mapping.addMapper(DbImportObjectCreationMapper.NewInstance(this, "source", REFERENCE_NAMESPACE)); |
|
69 | 69 |
} |
70 |
|
|
70 |
|
|
71 | 71 |
return mapping; |
72 | 72 |
} |
73 | 73 |
|
... | ... | |
86 | 86 |
Map<Object, Map<String, ? extends CdmBase>> result = new HashMap<Object, Map<String, ? extends CdmBase>>(); |
87 | 87 |
return result; |
88 | 88 |
} |
89 |
|
|
89 |
|
|
90 | 90 |
@Override |
91 |
public Reference<?> createObject(ResultSet rs, CentralAfricaChecklistImportState state) throws SQLException {
|
|
92 |
Reference<?> ref = ReferenceFactory.newGeneric();
|
|
91 |
public Reference createObject(ResultSet rs, CentralAfricaChecklistImportState state) throws SQLException { |
|
92 |
Reference ref = ReferenceFactory.newGeneric(); |
|
93 | 93 |
String sourceString = rs.getString("source"); |
94 | 94 |
ref.setTitle(sourceString); |
95 | 95 |
return ref; |
... | ... | |
100 | 100 |
IOValidator<CentralAfricaChecklistImportState> validator = new CentralAfricaChecklistTaxonImportValidator(); |
101 | 101 |
return validator.validate(state); |
102 | 102 |
} |
103 |
|
|
104 |
|
|
103 |
|
|
104 |
|
|
105 | 105 |
/* (non-Javadoc) |
106 | 106 |
* @see eu.etaxonomy.cdm.io.common.CdmIoBase#isIgnore(eu.etaxonomy.cdm.io.common.IImportConfigurator) |
107 | 107 |
*/ |
108 |
protected boolean isIgnore(CentralAfricaChecklistImportState state){ |
|
108 |
@Override |
|
109 |
protected boolean isIgnore(CentralAfricaChecklistImportState state){ |
|
109 | 110 |
return state.getConfig().getDoReferences().equals(IImportConfigurator.DO_REFERENCES.NONE); |
110 | 111 |
} |
111 | 112 |
|
Also available in: Unified diff
Remove generics from Reference in cdmlib-app #5830