Project

General

Profile

« Previous | Next » 

Revision 07c3eb13

Added by Katja Luther over 8 years ago

fix delete of specimen with specimenDescriptions

View differences:

cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/TaxonServiceImpl.java
1313 1313

  
1314 1314
        if (result.isOk()){
1315 1315

  
1316
            synonym = CdmBase.deproxy(dao.merge(synonym), Synonym.class);
1316
            synonym = HibernateProxyHelper.deproxy(dao.merge(synonym), Synonym.class);
1317 1317

  
1318 1318
            //remove synonymRelationship
1319 1319
            Set<Taxon> taxonSet = new HashSet<Taxon>();
......
3064 3064
            if (!(ref instanceof TaxonNameBase)){
3065 3065
            	message = null;
3066 3066
                if (!config.isDeleteSynonymRelations() && (ref instanceof SynonymRelationship)){
3067
                    message = "The Taxon can't be deleted as long as it has synonyms.";
3067
                    message = "The taxon can't be deleted as long as it has synonyms.";
3068 3068

  
3069 3069
                }
3070 3070
                if (!config.isDeleteDescriptions() && (ref instanceof DescriptionBase)){
3071
                    message = "The Taxon can't be deleted as long as it has factual data.";
3071
                    message = "The taxon can't be deleted as long as it has factual data.";
3072 3072

  
3073 3073
                }
3074 3074

  
3075 3075
                if (!config.isDeleteTaxonNodes() && (ref instanceof TaxonNode)){
3076
                    message = "The Taxon can't be deleted as long as it belongs to a taxon node.";
3076
                    message = "The taxon can't be deleted as long as it belongs to a taxon node.";
3077 3077

  
3078 3078
                }
3079 3079
                if (!config.isDeleteTaxonRelationships() && (ref instanceof TaxonNode)){
3080 3080
                    if (!config.isDeleteMisappliedNamesAndInvalidDesignations() && (((TaxonRelationship)ref).getType().equals(TaxonRelationshipType.MISAPPLIED_NAME_FOR())|| ((TaxonRelationship)ref).getType().equals(TaxonRelationshipType.INVALID_DESIGNATION_FOR()))){
3081
                        message = "The Taxon can't be deleted as long as it has misapplied names or invalid designations.";
3081
                        message = "The taxon can't be deleted as long as it has misapplied names or invalid designations.";
3082 3082

  
3083 3083
                    } else{
3084
                        message = "The Taxon can't be deleted as long as it belongs to a taxon node.";
3084
                        message = "The taxon can't be deleted as long as it belongs to a taxon node.";
3085 3085

  
3086 3086
                    }
3087 3087
                }
3088 3088
                if (ref instanceof PolytomousKeyNode){
3089
                    message = "The Taxon can't be deleted as long as it is referenced by a polytomous key node.";
3089
                    message = "The taxon can't be deleted as long as it is referenced by a polytomous key node.";
3090 3090

  
3091 3091
                }
3092 3092

  
3093 3093
                if (HibernateProxyHelper.isInstanceOf(ref, IIdentificationKey.class)){
3094
                   message = "Taxon can't be deleted as it is used in an identification key. Remove from identification key prior to deleting this name";
3094
                   message = "Taxon can't be deleted as it is used in an identification key. Remove from identification key prior to deleting this taxon";
3095 3095

  
3096 3096

  
3097 3097
                }

Also available in: Unified diff