Revision 0ecfd682
Added by Andreas Müller almost 8 years ago
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/common/DeduplicationHelper.java | ||
---|---|---|
353 | 353 |
for (Annotation annotation : annotatableEntity2.getAnnotations()){ |
354 | 354 |
Annotation clone = null; |
355 | 355 |
try { |
356 |
clone = annotation.clone(annotatableEntity1);
|
|
356 |
clone = (Annotation)annotation.clone();
|
|
357 | 357 |
} catch (CloneNotSupportedException e) { |
358 | 358 |
e.printStackTrace(); |
359 | 359 |
} |
... | ... | |
364 | 364 |
annotatableEntity2.removeAnnotation(annotation); |
365 | 365 |
session.delete(annotation); |
366 | 366 |
} |
367 |
|
|
367 | 368 |
//marker |
368 | 369 |
List<Marker> removeListMarker = new ArrayList<Marker>(); |
369 | 370 |
for (Marker marker : annotatableEntity2.getMarkers()){ |
370 | 371 |
Marker clone = null; |
371 | 372 |
try { |
372 |
clone = marker.clone(annotatableEntity1);
|
|
373 |
clone = (Marker)marker.clone();
|
|
373 | 374 |
} catch (CloneNotSupportedException e) { |
374 | 375 |
e.printStackTrace(); |
375 | 376 |
} |
... | ... | |
390 | 391 |
* @param cdmBase2 |
391 | 392 |
* @param session |
392 | 393 |
*/ |
393 |
//TODO Why do we not handle credits (credits are reusable), identifier and sources here
|
|
394 |
//TODO Why do we not handle credits (credits are reusable), rights and sources here
|
|
394 | 395 |
private <T> void copyIdentifiableExtensions(T cdmBase1, T cdmBase2, |
395 | 396 |
Session session) { |
396 | 397 |
IdentifiableEntity identifiableEntity1 = (IdentifiableEntity)cdmBase1; |
... | ... | |
400 | 401 |
List<Extension> removeListExtension = new ArrayList<Extension>(); |
401 | 402 |
for (Extension changeObject : (Set<Extension>)identifiableEntity2.getExtensions()){ |
402 | 403 |
try { |
403 |
Extension clone = changeObject.clone(identifiableEntity1);
|
|
404 |
Extension clone = (Extension)changeObject.clone();
|
|
404 | 405 |
identifiableEntity1.addExtension(clone); |
405 | 406 |
removeListExtension.add(changeObject); |
406 | 407 |
} catch (CloneNotSupportedException e) { |
... | ... | |
417 | 418 |
List<Identifier> removeListIdentifier = new ArrayList<Identifier>(); |
418 | 419 |
for (Identifier<?> changeObject : (List<Identifier>)identifiableEntity2.getIdentifiers()){ |
419 | 420 |
try { |
420 |
Identifier<?> clone = changeObject.clone(identifiableEntity1);
|
|
421 |
Identifier<?> clone = (Identifier)changeObject.clone();
|
|
421 | 422 |
identifiableEntity1.addIdentifier(clone); |
422 | 423 |
removeListIdentifier.add(changeObject); |
423 | 424 |
} catch (CloneNotSupportedException e) { |
Also available in: Unified diff
Remove bidirectionality for supplemental data #5743