Revision ac05a823
Added by Katja Luther about 5 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/DistributionEditorPart.java | ||
---|---|---|
231 | 231 |
protected void saveDistributions() { |
232 | 232 |
Set<TaxonDistributionDTO> coll = new HashSet(); |
233 | 233 |
editor.getDescriptionsToSave().forEach(dto->coll.add(dto)); |
234 |
Set<TaxonDistributionDTO> removeList = new HashSet(); |
|
234 | 235 |
for (TaxonDistributionDTO dto: coll){ |
235 | 236 |
Taxon taxon = null; |
236 | 237 |
for(TaxonDescription desc: dto.getDescriptionsWrapper().getDescriptions()){ |
... | ... | |
241 | 242 |
taxon.addDescription(desc); |
242 | 243 |
} |
243 | 244 |
if (taxon != null){ |
244 |
CdmStore.getService(ITaxonService.class).merge(taxon, true); |
|
245 |
MergeResult result = CdmStore.getService(ITaxonService.class).merge(taxon, true); |
|
246 |
boolean removed = dto.getDescriptionsWrapper().getDescriptions().remove(desc); |
|
247 |
System.err.println("removed:" + removed); |
|
245 | 248 |
} |
246 | 249 |
} |
247 | 250 |
} |
248 |
|
|
251 |
coll.removeAll(removeList); |
|
249 | 252 |
List<MergeResult<DescriptionBase>> result = CdmStore.getService(IDescriptionService.class).mergeDescriptionElements(coll, true); |
250 | 253 |
for (MergeResult<DescriptionBase> mergeRes: result ){ |
251 | 254 |
cdmEntitySession.load(mergeRes, true); |
Also available in: Unified diff
ref #7854: fix problem of wrong setting of values in other cell