private Map<TaxonBase, TaxonBaseDeletionConfigurator> toDeletes = new HashMap<>();
private Set<Synonym> toSaveNewSynonyms = new HashSet<>();
- private Set<TaxonBase> toSaveNewConcepts = new HashSet<>();
- private Set<TaxonName> toSaveNewNames = new HashSet<>();
+ private List<TaxonBase> toSaveNewConcepts = new ArrayList<>();
+ private List<TaxonName> toSaveNewNames = new ArrayList<>();
private Set<AbstractPostTaxonOperation> operations = new HashSet<>();
this.toSaveNewSynonyms.add(toSaveNew);
}
public void addToSaveNewConcept(Taxon toSaveNew) {
- if (!toSaveNew.isPersited()){
- this.toSaveNewConcepts.add(toSaveNew);
- }
+ this.toSaveNewConcepts.add(toSaveNew);
+
}
@Override
for (Synonym syn: toSaveNewSynonyms){
for (HybridRelationship rel : syn.getName().getHybridChildRelations()){
- if (!rel.getParentName().isPersited()) {
+// if (!rel.getParentName().isPersited()) {
toSaveNewNames.add(rel.getParentName());
- }
- if (!rel.getHybridName().isPersited()) {
+// }
+// if (!rel.getHybridName().isPersited()) {
toSaveNewNames.add(rel.getHybridName());
- }
+// }
}
}
for (TaxonBase concept: toSaveNewConcepts){
for (HybridRelationship rel : concept.getName().getHybridChildRelations()){
- if (!rel.getParentName().isPersited()) {
+// if (!rel.getParentName().isPersited()) {
toSaveNewNames.add(rel.getParentName());
- }
- if (!rel.getHybridName().isPersited()) {
+// }
+// if (!rel.getHybridName().isPersited()) {
toSaveNewNames.add(rel.getHybridName());
- }
+// }
}
}
- CdmStore.getService(INameService.class).save(toSaveNewNames);
- CdmStore.getService(ITaxonService.class).save(toSaveNewConcepts);
+ CdmStore.getService(INameService.class).merge(toSaveNewNames, true);
+ CdmStore.getService(ITaxonService.class).merge(toSaveNewConcepts, true);
toSaveNewNames.clear();
toSaveNewConcepts.clear();