Project

General

Profile

Revision 88b1995d

ID88b1995de5de6346195f2a134bcaade3ad910e06
Parent 3fa85b45
Child aabd8c12, 08a698af, 904c8661

Added by Katja Luther over 3 years ago

ref #5431: the type designation blocks the name deletion only if it is the type name

View differences:

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

Add picture from clipboard (Maximum size: 40 MB)