Project

General

Profile

Revision 56897765

ID568977652f2eac0ac7565656889e46ffbbc566e8
Parent aaf1bca4
Child e85167f1

Added by Patrick Plitzner about 3 years ago

Fix exception message

View differences:

cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/OccurrenceServiceImpl.java
1112 1112
            // check for type designation
1113 1113
            if (cdmBase.isInstanceOf(SpecimenTypeDesignation.class) && !specimenDeleteConfigurator.isDeleteFromTypeDesignation()) {
1114 1114
                deleteResult.setAbort();
1115
                deleteResult.addException(new ReferencedObjectUndeletableException("Specimen is a type specimen."));
1115
                deleteResult.addException(new ReferencedObjectUndeletableException("Specimen or obeservation is a type specimen."));
1116 1116
                deleteResult.addRelatedObject(cdmBase);
1117 1117
                break;
1118 1118
            }
1119 1119
            // check for IndividualsAssociations
1120 1120
            else if (cdmBase.isInstanceOf(IndividualsAssociation.class) && !specimenDeleteConfigurator.isDeleteFromIndividualsAssociation()) {
1121 1121
                deleteResult.setAbort();
1122
                deleteResult.addException(new ReferencedObjectUndeletableException("Specimen is still associated via IndividualsAssociations"));
1122
                deleteResult.addException(new ReferencedObjectUndeletableException("Specimen or obeservation is still associated via IndividualsAssociations"));
1123 1123
                deleteResult.addRelatedObject(cdmBase);
1124 1124
                break;
1125 1125
            }
......
1128 1128
                    && HibernateProxyHelper.deproxy(cdmBase, TaxonDescription.class).getDescribedSpecimenOrObservation().equals(specimen)
1129 1129
                    && !specimenDeleteConfigurator.isDeleteFromDescription()){
1130 1130
                deleteResult.setAbort();
1131
                deleteResult.addException(new ReferencedObjectUndeletableException("Specimen is still used as \"Described Specimen\" in a taxon description."));
1131
                deleteResult.addException(new ReferencedObjectUndeletableException("Specimen or obeservation is still used as \"Described Specimen\" in a taxon description."));
1132 1132
                deleteResult.addRelatedObject(cdmBase);
1133 1133
                break;
1134 1134
            }
......
1145 1145
                    if(!specimenDeleteConfigurator.isDeleteChildren()){
1146 1146
                        //if children should not be deleted then it is undeletable
1147 1147
                        deleteResult.setAbort();
1148
                        deleteResult.addException(new ReferencedObjectUndeletableException("Derivative still has child derivatives."));
1148
                        deleteResult.addException(new ReferencedObjectUndeletableException("Specimen or obeservation still has child derivatives."));
1149 1149
                        deleteResult.addRelatedObject(cdmBase);
1150 1150
                        break;
1151 1151
                    }

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)