Revision 88b1995d
ref #5431: the type designation blocks the name deletion only if it is the type name
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/NameServiceImpl.java | ||
---|---|---|
929 | 929 |
} |
930 | 930 |
//NameTypeDesignation#typeName |
931 | 931 |
else if (referencingObject.isInstanceOf(NameTypeDesignation.class)){ |
932 |
String message = "Name can't be deleted as it is used as a name type in a NameTypeDesignation"; |
|
933 |
result.addException(new ReferencedObjectUndeletableException(message)); |
|
934 |
result.addRelatedObject(referencingObject); |
|
935 |
result.setAbort(); |
|
932 |
NameTypeDesignation typeDesignation = HibernateProxyHelper.deproxy(referencingObject, NameTypeDesignation.class); |
|
933 |
|
|
934 |
if (typeDesignation.getTypeName().equals(name)){ |
|
935 |
String message = "Name can't be deleted as it is used as a name type in a NameTypeDesignation"; |
|
936 |
result.addException(new ReferencedObjectUndeletableException(message)); |
|
937 |
result.addRelatedObject(referencingObject); |
|
938 |
result.setAbort(); |
|
939 |
} |
|
936 | 940 |
} |
937 | 941 |
//DeterminationEvent#taxonName |
938 | 942 |
else if (referencingObject.isInstanceOf(DeterminationEvent.class)){ |
Also available in: Unified diff