Revision 9dbe8889
Added by Andreas Müller over 2 years ago
app-import/src/main/java/eu/etaxonomy/cdm/io/berlinModel/in/BerlinModelReferenceImport.java | ||
---|---|---|
60 | 60 |
import eu.etaxonomy.cdm.io.common.mapping.berlinModel.CdmOneToManyMapper; |
61 | 61 |
import eu.etaxonomy.cdm.io.common.mapping.berlinModel.CdmStringMapper; |
62 | 62 |
import eu.etaxonomy.cdm.io.common.mapping.berlinModel.CdmUriMapper; |
63 |
import eu.etaxonomy.cdm.io.common.utils.ImportDeduplicationHelper; |
|
64 | 63 |
import eu.etaxonomy.cdm.model.agent.Person; |
65 | 64 |
import eu.etaxonomy.cdm.model.agent.Team; |
66 | 65 |
import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase; |
... | ... | |
100 | 99 |
public static final UUID DATE_STRING_UUID = UUID.fromString("e4130eae-606e-4b0c-be4f-e93dc161be7d"); |
101 | 100 |
public static final UUID IS_PAPER_UUID = UUID.fromString("8a326129-d0d0-4f9d-bbdf-8d86b037c65e"); |
102 | 101 |
|
103 |
private static ImportDeduplicationHelper<BerlinModelImportState> deduplicationHelper; |
|
104 |
|
|
105 | 102 |
private final int modCount = 1000; |
106 | 103 |
private static final String pluralString = "references"; |
107 | 104 |
private static final String dbTableName = "reference"; |
... | ... | |
194 | 191 |
@Override |
195 | 192 |
protected void doInvoke(BerlinModelImportState state){ |
196 | 193 |
logger.info("start make " + getPluralString() + " ..."); |
197 |
deduplicationHelper = ImportDeduplicationHelper.NewInstance(this, state); |
|
198 | 194 |
|
199 | 195 |
boolean success = true; |
200 | 196 |
initializeMappers(state); |
... | ... | |
266 | 262 |
if (! success){ |
267 | 263 |
state.setUnsuccessfull(); |
268 | 264 |
} |
269 |
deduplicationHelper = null; |
|
270 | 265 |
return; |
271 | 266 |
} |
272 | 267 |
|
273 | 268 |
|
274 | 269 |
@Override |
275 | 270 |
public boolean doPartition(@SuppressWarnings("rawtypes") ResultSetPartitioner partitioner, BerlinModelImportState state) { |
276 |
deduplicationHelper.restartSession();
|
|
271 |
state.getDeduplicationHelper().restartSession();
|
|
277 | 272 |
|
278 | 273 |
if (state.isReferenceSecondPath()){ |
279 | 274 |
return doPartitionSecondPath(partitioner, state); |
... | ... | |
1309 | 1304 |
} |
1310 | 1305 |
|
1311 | 1306 |
private <T extends TeamOrPersonBase<?>> T deduplicatePersonOrTeam(BerlinModelImportState state,T author) { |
1312 |
T result = deduplicationHelper.getExistingAuthor(state, author);
|
|
1307 |
T result = state.getDeduplicationHelper().getExistingAuthor(author);
|
|
1313 | 1308 |
return result; |
1314 | 1309 |
} |
1315 | 1310 |
|
1316 | 1311 |
private Reference deduplicateReference(BerlinModelImportState state,Reference ref) { |
1317 |
Reference result = deduplicationHelper.getExistingReference(state, ref);
|
|
1312 |
Reference result = state.getDeduplicationHelper().getExistingReference(ref);
|
|
1318 | 1313 |
return result; |
1319 | 1314 |
} |
1320 | 1315 |
|
Also available in: Unified diff
ref #9890 move importDeduplicationHelper to import state and include state in helper (cont.) - appimport