Revision e17b1d77
Added by Andreas Müller over 6 years ago
app-import/src/main/java/eu/etaxonomy/cdm/io/berlinModel/in/BerlinModelReferenceImport.java | ||
---|---|---|
203 | 203 |
int recordsPerTransaction = config.getRecordsPerTransaction(); |
204 | 204 |
try{ |
205 | 205 |
//firstPath |
206 |
ResultSetPartitioner partitioner = ResultSetPartitioner.NewInstance(source, strIdQueryFirstPath, strRecordQuery, recordsPerTransaction); |
|
206 |
ResultSetPartitioner<BerlinModelImportState> partitioner = |
|
207 |
ResultSetPartitioner.NewInstance(source, strIdQueryFirstPath, strRecordQuery, recordsPerTransaction); |
|
207 | 208 |
while (partitioner.nextPartition()){ |
208 | 209 |
partitioner.doPartition(this, state); |
209 | 210 |
} |
... | ... | |
241 | 242 |
} |
242 | 243 |
boolean success = true; |
243 | 244 |
|
244 |
Map<Integer, Reference> refToSave = new HashMap<Integer, Reference>();
|
|
245 |
Map<Integer, Reference> refToSave = new HashMap<>(); |
|
245 | 246 |
|
246 | 247 |
@SuppressWarnings("unchecked") |
247 | 248 |
Map<String, Reference> relatedReferences = partitioner.getObjectMap(REFERENCE_NAMESPACE); |
... | ... | |
352 | 353 |
Class<?> cdmClass; |
353 | 354 |
Set<String> idSet; |
354 | 355 |
|
355 |
Map<Object, Map<String, ? extends CdmBase>> result = new HashMap<Object, Map<String, ? extends CdmBase>>();
|
|
356 |
Map<Object, Map<String, ? extends CdmBase>> result = new HashMap<>(); |
|
356 | 357 |
|
357 | 358 |
try{ |
358 | 359 |
Set<String> teamIdSet = new HashSet<>(); |
... | ... | |
696 | 697 |
if (logger.isDebugEnabled()){logger.debug("RefType 'Journal'");} |
697 | 698 |
Reference journal = ReferenceFactory.newJournal(); |
698 | 699 |
|
699 |
Set<String> omitAttributes = new HashSet<String>();
|
|
700 |
Set<String> omitAttributes = new HashSet<>(); |
|
700 | 701 |
String series = "series"; |
701 | 702 |
// omitAttributes.add(series); |
702 | 703 |
|
... | ... | |
818 | 819 |
private boolean makeStandardSingleMapper(Map<String, Object> valueMap, CdmBase cdmBase, CdmSingleAttributeMapperBase mapper, Set<String> omitAttributes){ |
819 | 820 |
boolean result = true; |
820 | 821 |
if (omitAttributes == null){ |
821 |
omitAttributes = new HashSet<String>();
|
|
822 |
omitAttributes = new HashSet<>(); |
|
822 | 823 |
} |
823 | 824 |
if (mapper instanceof DbImportExtensionMapper){ |
824 | 825 |
result &= ((DbImportExtensionMapper)mapper).invoke(valueMap, cdmBase); |
... | ... | |
848 | 849 |
|
849 | 850 |
private boolean makeMultipleValueAddMapper(Map<String, Object> valueMap, CdmBase cdmBase, CdmOneToManyMapper<CdmBase, CdmBase, CdmSingleAttributeMapperBase> mapper, Set<String> omitAttributes){ |
850 | 851 |
if (omitAttributes == null){ |
851 |
omitAttributes = new HashSet<String>();
|
|
852 |
omitAttributes = new HashSet<>(); |
|
852 | 853 |
} |
853 | 854 |
boolean result = true; |
854 | 855 |
String destinationAttribute = mapper.getSingleAttributeName(); |
855 |
List<Object> sourceValues = new ArrayList<Object>();
|
|
856 |
List<Class> classes = new ArrayList<Class>();
|
|
856 |
List<Object> sourceValues = new ArrayList<>(); |
|
857 |
List<Class> classes = new ArrayList<>(); |
|
857 | 858 |
for (CdmSingleAttributeMapperBase singleMapper : mapper.getSingleMappers()){ |
858 | 859 |
String sourceAttribute = singleMapper.getSourceAttribute(); |
859 | 860 |
Object value = valueMap.get(sourceAttribute); |
... | ... | |
880 | 881 |
team.setNomenclaturalTitle(authorString); |
881 | 882 |
team.setTitleCache(authorString, true); |
882 | 883 |
state.addRelatedObject(REF_AUTHOR_NAMESPACE, authorString, team); |
883 |
team.addImportSource(authorString, REF_AUTHOR_NAMESPACE, state.getConfig().getSourceReference(), null);
|
|
884 |
team.addImportSource(authorString, REF_AUTHOR_NAMESPACE, state.getTransactionalSourceReference(), null);
|
|
884 | 885 |
} |
885 | 886 |
result = team; |
886 | 887 |
}else{ |
Also available in: Unified diff
fix transactional source reference issue in BM reference import