Revision 86536e03
Added by Andreas Müller almost 7 years ago
app-import/src/main/java/eu/etaxonomy/cdm/io/berlinModel/out/BerlinModelNameRelationExport.java | ||
---|---|---|
32 | 32 |
import eu.etaxonomy.cdm.model.name.HomotypicalGroup; |
33 | 33 |
import eu.etaxonomy.cdm.model.name.HybridRelationship; |
34 | 34 |
import eu.etaxonomy.cdm.model.name.NameRelationship; |
35 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
|
|
35 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
|
36 | 36 |
import eu.etaxonomy.cdm.model.reference.Reference; |
37 | 37 |
|
38 | 38 |
|
... | ... | |
144 | 144 |
Set<NameRelationship> basionymNameRels = new HashSet<NameRelationship>(); |
145 | 145 |
for (HomotypicalGroup homoGroup : list){ |
146 | 146 |
doCount(count++, modCount, "homotypical groups"); |
147 |
Set<TaxonNameBase> allNames = homoGroup.getTypifiedNames();
|
|
147 |
Set<TaxonName> allNames = homoGroup.getTypifiedNames(); |
|
148 | 148 |
if (allNames.size() > 1){ |
149 |
Set<TaxonNameBase> readyNames = new HashSet<TaxonNameBase>();
|
|
150 |
Set<TaxonNameBase> unrelateds = homoGroup.getUnrelatedNames();
|
|
151 |
for (TaxonNameBase unrelated : unrelateds){
|
|
152 |
for (TaxonNameBase oneOfAllNames: allNames){
|
|
149 |
Set<TaxonName> readyNames = new HashSet<>();
|
|
150 |
Set<TaxonName> unrelateds = homoGroup.getUnrelatedNames(); |
|
151 |
for (TaxonName unrelated : unrelateds){ |
|
152 |
for (TaxonName oneOfAllNames: allNames){ |
|
153 | 153 |
if(!unrelated.equals(oneOfAllNames) && ! readyNames.contains(oneOfAllNames)){ |
154 | 154 |
success &= invokeIsHomotypic(state, mapping, unrelated, oneOfAllNames, null, null); |
155 | 155 |
} |
... | ... | |
169 | 169 |
} |
170 | 170 |
} |
171 | 171 |
|
172 |
private boolean invokeIsHomotypic(BerlinModelExportState state, CdmDbExportMapping<BerlinModelExportState, BerlinModelExportConfigurator, IExportTransformer> mapping, TaxonNameBase fromName, TaxonNameBase toName, Reference refId, String microCitation) throws SQLException{
|
|
172 |
private boolean invokeIsHomotypic(BerlinModelExportState state, CdmDbExportMapping<BerlinModelExportState, BerlinModelExportConfigurator, IExportTransformer> mapping, TaxonName fromName, TaxonName toName, Reference refId, String microCitation) throws SQLException{
|
|
173 | 173 |
try{ |
174 | 174 |
logger.info(fromName.getTitleCache() + "->" + toName.getTitleCache()); |
175 | 175 |
String maxQuery = " SELECT max(relNameId) as max FROM relName "; |
... | ... | |
190 | 190 |
return true; |
191 | 191 |
} |
192 | 192 |
|
193 |
private Set<TaxonNameBase> getAllRelatedNames(Set<NameRelationship> rels){
|
|
194 |
Set<TaxonNameBase> result = new HashSet<TaxonNameBase>();
|
|
193 |
private Set<TaxonName> getAllRelatedNames(Set<NameRelationship> rels){ |
|
194 |
Set<TaxonName> result = new HashSet<>();
|
|
195 | 195 |
for (NameRelationship rel : rels){ |
196 | 196 |
result.add(rel.getFromName()); |
197 | 197 |
result.add(rel.getToName()); |
Also available in: Unified diff
fix #6368 rename table and class TaxonNameBase in app-import